chinacarapi 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .venv/
7
+ venv/
8
+ .env
9
+ .env.local
10
+ .DS_Store
@@ -0,0 +1,25 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 InnQByte, ChinaCarAPI (chinacarapi.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ Note: This MIT license covers the client library only. Access to the EnCarAPI
24
+ service and its data requires a valid API key and is subject to the terms at
25
+ https://encarapi.com.
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.5
2
+ Name: chinacarapi
3
+ Version: 1.0.0
4
+ Summary: Official Python client for ChinaCarAPI: Chinese used-car data from Dongchedi and Che168 as one REST API, in English.
5
+ Project-URL: Homepage, https://chinacarapi.com
6
+ Project-URL: Documentation, https://chinacarapi.com/documentation
7
+ Project-URL: Source, https://github.com/ThatMojo/chinacarapi-python
8
+ Author-email: ChinaCarAPI <support@chinacarapi.com>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: che168 api,china car api,china car export,chinese car api,chinese used car data,dongchedi api,vehicle data api
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Requires-Python: >=3.8
18
+ Requires-Dist: encarapi>=1.0.0
19
+ Description-Content-Type: text/markdown
20
+
21
+ # ChinaCarAPI: Python client for Chinese car data (Dongchedi API, Che168 API)
22
+
23
+ Official **Python client** for [ChinaCarAPI](https://chinacarapi.com), a REST
24
+ **China car API** for the Chinese used-car market. One API for **Dongchedi (懂车帝)** and
25
+ **Che168 (车168, Autohome)**: 400,000+ listings with price, mileage, first registration, seller,
26
+ photos, inspection reports (accident, flood, fire, EV battery), price history and export status.
27
+ Delivered in English, with the original Chinese kept alongside.
28
+
29
+ Built for car exporters, importers, dealers and marketplaces that need reliable **Chinese car data**
30
+ without scrapers, captchas, proxies or Chinese-language parsing.
31
+
32
+ > **A ChinaCarAPI key is required.** The API and its data are a paid service. This client only
33
+ > works with a key from [chinacarapi.com](https://chinacarapi.com) (5-day trial available).
34
+ > EnCarAPI keys with the China add-on work as well.
35
+
36
+ ## Install
37
+
38
+ ```bash
39
+ pip install chinacarapi
40
+ ```
41
+
42
+ Requires Python 3.8+.
43
+
44
+ This package is the China entry point of [`encarapi`](https://pypi.org/project/encarapi/),
45
+ the official client for Korean **and** Chinese used car data. Need both markets? Use
46
+ `EnCarAPI(key)` with `client.korea` and `client.china` (exported here as well).
47
+
48
+ ## Quick start
49
+
50
+ ```python
51
+ from chinacarapi import ChinaCarAPI
52
+
53
+ # Get your key at https://chinacarapi.com
54
+ client = ChinaCarAPI("YOUR_API_KEY") # or set CHINACARAPI_KEY
55
+
56
+ # Export-ready BYDs, cheapest first, from both marketplaces (duplicates merged)
57
+ page = client.catalog(make="BYD", export_ready=True, sort="price_asc", limit=25)
58
+
59
+ # Full record: price history, photos, seller, alsoListedOn (same car on the other marketplace)
60
+ car = client.vehicle(page["results"][0]["id"])
61
+
62
+ # Inspection report: accident, flood and fire checklist, battery data for EVs
63
+ report = client.inspection(page["results"][0]["id"])
64
+ ```
65
+
66
+ Without a valid key every call raises a `ChinaCarAPIError` pointing to
67
+ [chinacarapi.com](https://chinacarapi.com). There is no free data in this package, only a clean
68
+ client for the paid API.
69
+
70
+ ## API
71
+
72
+ | Method | Endpoint | Description |
73
+ |---|---|---|
74
+ | `client.catalog(**filters)` | `GET /api/catalog` | Search and filter listings (Dongchedi + Che168) |
75
+ | `client.vehicle(id)` | `GET /api/vehicle/:id` | Full record of one car |
76
+ | `client.inspection(id)` | `GET /api/inspection/:id` | Inspection report |
77
+ | `client.bulk(ids)` | `POST /api/vehicle/bulk` | Up to 500 records per call |
78
+ | `client.changes(since=... \| cursor=...)` | `GET /api/catalog/changes` | Change feed: new cars, price changes, removals |
79
+ | `client.export_csv()` | `GET /api/catalog/export` | Full catalog as CSV |
80
+ | `client.enums()` | `GET /api/enums` | Makes, fuels, cities, sources with counts |
81
+ | `client.models(make)` | `GET /api/models` | Models of one make |
82
+
83
+ **Catalog filters:** `source` (`dongchedi`, `che168`), `duplicates=include`, `make`, `model`,
84
+ `year_min`/`year_max`, `reg_year_min`/`reg_year_max`, `price_min`/`price_max` (CNY),
85
+ `mileage_max`, `city`, `fuel`, `has_report`, `export_ready` (China's 180-day rule for used-car
86
+ exports), `updated_since`, `sort`, `page`, `limit`, `lang="zh"` for the original Chinese values.
87
+
88
+ Full reference (OpenAPI 3.1, 13 languages): [chinacarapi.com/documentation](https://chinacarapi.com/documentation)
89
+
90
+ ## Keeping a local copy
91
+
92
+ ```python
93
+ first = client.changes(since="2026-10-01T00:00:00Z")
94
+ # store first["nextCursor"], then poll every few minutes:
95
+ nxt = client.changes(cursor=first["nextCursor"])
96
+ ```
97
+
98
+ ## Why ChinaCarAPI?
99
+
100
+ - **Dongchedi API and Che168 API in one**: the same car listed on both is merged and linked.
101
+ - **English output**: official English make and model names, translated trims and inspection findings.
102
+ - **Export status**: ready-made filter for China's 180-day rule on used-car exports.
103
+ - **Plans from €99/month**, 5-day trial for €9.99. EnCarAPI (Korea) customers add China from €39/month.
104
+
105
+ Korean car data: see [EnCarAPI](https://encarapi.com) and its [Python client](https://github.com/ThatMojo/encarapi-python).
106
+
107
+ ## License
108
+
109
+ MIT for this client. The data is only available through a ChinaCarAPI subscription.
@@ -0,0 +1,89 @@
1
+ # ChinaCarAPI: Python client for Chinese car data (Dongchedi API, Che168 API)
2
+
3
+ Official **Python client** for [ChinaCarAPI](https://chinacarapi.com), a REST
4
+ **China car API** for the Chinese used-car market. One API for **Dongchedi (懂车帝)** and
5
+ **Che168 (车168, Autohome)**: 400,000+ listings with price, mileage, first registration, seller,
6
+ photos, inspection reports (accident, flood, fire, EV battery), price history and export status.
7
+ Delivered in English, with the original Chinese kept alongside.
8
+
9
+ Built for car exporters, importers, dealers and marketplaces that need reliable **Chinese car data**
10
+ without scrapers, captchas, proxies or Chinese-language parsing.
11
+
12
+ > **A ChinaCarAPI key is required.** The API and its data are a paid service. This client only
13
+ > works with a key from [chinacarapi.com](https://chinacarapi.com) (5-day trial available).
14
+ > EnCarAPI keys with the China add-on work as well.
15
+
16
+ ## Install
17
+
18
+ ```bash
19
+ pip install chinacarapi
20
+ ```
21
+
22
+ Requires Python 3.8+.
23
+
24
+ This package is the China entry point of [`encarapi`](https://pypi.org/project/encarapi/),
25
+ the official client for Korean **and** Chinese used car data. Need both markets? Use
26
+ `EnCarAPI(key)` with `client.korea` and `client.china` (exported here as well).
27
+
28
+ ## Quick start
29
+
30
+ ```python
31
+ from chinacarapi import ChinaCarAPI
32
+
33
+ # Get your key at https://chinacarapi.com
34
+ client = ChinaCarAPI("YOUR_API_KEY") # or set CHINACARAPI_KEY
35
+
36
+ # Export-ready BYDs, cheapest first, from both marketplaces (duplicates merged)
37
+ page = client.catalog(make="BYD", export_ready=True, sort="price_asc", limit=25)
38
+
39
+ # Full record: price history, photos, seller, alsoListedOn (same car on the other marketplace)
40
+ car = client.vehicle(page["results"][0]["id"])
41
+
42
+ # Inspection report: accident, flood and fire checklist, battery data for EVs
43
+ report = client.inspection(page["results"][0]["id"])
44
+ ```
45
+
46
+ Without a valid key every call raises a `ChinaCarAPIError` pointing to
47
+ [chinacarapi.com](https://chinacarapi.com). There is no free data in this package, only a clean
48
+ client for the paid API.
49
+
50
+ ## API
51
+
52
+ | Method | Endpoint | Description |
53
+ |---|---|---|
54
+ | `client.catalog(**filters)` | `GET /api/catalog` | Search and filter listings (Dongchedi + Che168) |
55
+ | `client.vehicle(id)` | `GET /api/vehicle/:id` | Full record of one car |
56
+ | `client.inspection(id)` | `GET /api/inspection/:id` | Inspection report |
57
+ | `client.bulk(ids)` | `POST /api/vehicle/bulk` | Up to 500 records per call |
58
+ | `client.changes(since=... \| cursor=...)` | `GET /api/catalog/changes` | Change feed: new cars, price changes, removals |
59
+ | `client.export_csv()` | `GET /api/catalog/export` | Full catalog as CSV |
60
+ | `client.enums()` | `GET /api/enums` | Makes, fuels, cities, sources with counts |
61
+ | `client.models(make)` | `GET /api/models` | Models of one make |
62
+
63
+ **Catalog filters:** `source` (`dongchedi`, `che168`), `duplicates=include`, `make`, `model`,
64
+ `year_min`/`year_max`, `reg_year_min`/`reg_year_max`, `price_min`/`price_max` (CNY),
65
+ `mileage_max`, `city`, `fuel`, `has_report`, `export_ready` (China's 180-day rule for used-car
66
+ exports), `updated_since`, `sort`, `page`, `limit`, `lang="zh"` for the original Chinese values.
67
+
68
+ Full reference (OpenAPI 3.1, 13 languages): [chinacarapi.com/documentation](https://chinacarapi.com/documentation)
69
+
70
+ ## Keeping a local copy
71
+
72
+ ```python
73
+ first = client.changes(since="2026-10-01T00:00:00Z")
74
+ # store first["nextCursor"], then poll every few minutes:
75
+ nxt = client.changes(cursor=first["nextCursor"])
76
+ ```
77
+
78
+ ## Why ChinaCarAPI?
79
+
80
+ - **Dongchedi API and Che168 API in one**: the same car listed on both is merged and linked.
81
+ - **English output**: official English make and model names, translated trims and inspection findings.
82
+ - **Export status**: ready-made filter for China's 180-day rule on used-car exports.
83
+ - **Plans from €99/month**, 5-day trial for €9.99. EnCarAPI (Korea) customers add China from €39/month.
84
+
85
+ Korean car data: see [EnCarAPI](https://encarapi.com) and its [Python client](https://github.com/ThatMojo/encarapi-python).
86
+
87
+ ## License
88
+
89
+ MIT for this client. The data is only available through a ChinaCarAPI subscription.
@@ -0,0 +1,10 @@
1
+ """ChinaCarAPI: Chinese used-car data (Dongchedi + Che168) as one REST API. Key required: https://chinacarapi.com
2
+
3
+ This package is the China entry point of ``encarapi`` (one client for Korean and
4
+ Chinese used car data). It keeps the ``chinacarapi`` name and API:
5
+ ``ChinaCarAPI(key).catalog()``, ``.vehicle()``, ``.inspection()``, ``.bulk()``, ...
6
+ """
7
+ from encarapi import ChinaCarAPI, ChinaCarAPIError, EnCarAPI, MissingApiKeyError
8
+
9
+ __all__ = ["ChinaCarAPI", "ChinaCarAPIError", "MissingApiKeyError", "EnCarAPI"]
10
+ __version__ = "1.0.0"
@@ -0,0 +1,8 @@
1
+ # CHINACARAPI_KEY=your_key python examples/quickstart.py
2
+ from chinacarapi import ChinaCarAPI
3
+
4
+ client = ChinaCarAPI() # reads CHINACARAPI_KEY; get a key at https://chinacarapi.com
5
+ page = client.catalog(make="BYD", export_ready=True, sort="price_asc", limit=5)
6
+ print(f"{page['total']} export-ready BYD cars, cheapest:")
7
+ for car in page["results"]:
8
+ print(f"{car['title']} | {car['mileageKm']} km | {car['price']['eur']} EUR | {car['source']}")
@@ -0,0 +1,38 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "chinacarapi"
7
+ version = "1.0.0"
8
+ description = "Official Python client for ChinaCarAPI: Chinese used-car data from Dongchedi and Che168 as one REST API, in English."
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "ChinaCarAPI", email = "support@chinacarapi.com" }]
13
+ keywords = [
14
+ "china car api",
15
+ "chinese car api",
16
+ "dongchedi api",
17
+ "che168 api",
18
+ "chinese used car data",
19
+ "china car export",
20
+ "vehicle data api",
21
+ ]
22
+ classifiers = [
23
+ "Development Status :: 4 - Beta",
24
+ "Intended Audience :: Developers",
25
+ "License :: OSI Approved :: MIT License",
26
+ "Programming Language :: Python :: 3",
27
+ "Topic :: Software Development :: Libraries :: Python Modules",
28
+ ]
29
+ dependencies = ["encarapi>=1.0.0"]
30
+
31
+ [project.urls]
32
+ Homepage = "https://chinacarapi.com"
33
+ Documentation = "https://chinacarapi.com/documentation"
34
+ Source = "https://github.com/ThatMojo/chinacarapi-python"
35
+
36
+ [tool.hatch.build.targets.wheel]
37
+ packages = ["chinacarapi"]
38
+