开发文档
AUTO.RIA 接口车辆信息与搜索参考
AUTO.RIA 接口参考:每个操作的输入作用、取值范围与别名,以及autoria-search等操作返回的字段。
另见: AUTO.RIA车辆信息接口概览与价格 · AUTO.RIA 接口指南:车辆信息与搜索
本页内容
autoria-listing:id命名空间,以及已售出或已归档广告的返回内容
autoria-listing的id就是autoria-search或autoria-search-ids为该广告返回的id;body.listing_type告诉AUTO.RIA从两个id命名空间中的哪一个读取,默认为used。该默认值涵盖来自used、order与all搜索的id,而new只用于来自new搜索的id;由于新车与二手车的范围存在重叠,用错误的listing_type读取同一个数字可能会得到完全不同的车辆,而不是直接失败。
已售出或已归档的广告仍然是一次成功的查询:其data中带有is_sold、is_active与from_archive,与该行的其他字段一起返回,这些字段与在售广告携带的是同一组字段,只是取值不同,而不是另一种返回形状或错误。只有AUTO.RIA从未签发过的id才会被拒绝。
本节涉及的字段(5)
autoria-listing, autoria-search, autoria-search-ids, body.listing_id, body.listing_type
autoria-listings:批量id与AUTO.RIA无法识别的id
body.listing_ids在一个逗号分隔的字符串中最多接受25个广告id;除了这个25个的上限之外,其中每个id的读取方式都与单独调用autoria-listing时完全一致,包括整批id共用同一个body.listing_type,而不是让每个id各自选择命名空间。AUTO.RIA无法识别的id不会使整次调用失败:它会被放入not_found中,而每个成功解析的id仍会出现在results中,同一响应上的requested与returned则分别统计发送了多少个id、返回了多少行。用这种方式读取25个id,比分别发起25次autoria-listing调用的开销更低。
本节涉及的字段(4)
autoria-listings, autoria-listing, body.listing_ids, body.listing_type
autoria-makes:其他地方的厂商筛选所期望的id
body.category选择autoria-makes为AUTO.RIA八个目录中的哪一个列出厂商,默认为cars;每个目录的厂商列表完全独立,因此results中同一个数字id在不同类别下可能对应不同的厂商。results中每个条目的id正是其他地方body.make所期望的取值,与旁边的name对应;在之后的autoria-models或autoria-search调用中直接发送这个id而不是名称,可以省去名称解析所多花的那一次查询。
本节涉及的字段(5)
autoria-makes, autoria-models, autoria-search, body.category, body.make
autoria-models:一个厂商下的车型,以及响应中回传的厂商id
autoria-models的body.make是可选的,一旦发送,就接受autoria-makes返回的厂商名称或数字id;body.category与autoria-makes一样默认为cars。除了车型results之外,响应的data还会回传make与make_id,因此按名称提供厂商的调用方可以直接从同一响应中读到对应的数字id,而不必再单独调用autoria-makes。results中每个车型自己的id,正是之后调用autoria-search与autoria-search-ids时body.model(连同body.make一起发送后)所期望的取值。
本节涉及的字段(7)
autoria-models, autoria-makes, autoria-search, autoria-search-ids, body.make, body.category, body.model
autoria-reference:四个固定列表,以及其中不作为筛选条件的一个
body.list选择读取哪一个固定列表:categories、body_types、gearboxes或drive_types;它没有默认值,每次调用都必须发送。body.category把body_types与gearboxes限定到AUTO.RIA八个目录中的某一个,默认为cars,因为车身类型与变速箱类型因目录而异。
results中的条目在归属于同一列表中更大的条目之下时带有parent_id,否则就没有这个字段。drive_types与其他三者不同:AUTO.RIA在autoria-search的每一条列表上都会返回驱动类型,却没有提供按它筛选的输入,因此这个列表只用于读取可能的取值。
本节涉及的字段(4)
autoria-reference, autoria-search, body.list, body.category
autoria-regions:先是各州,再是某一州下的城市
不发送body.region会列出乌克兰各州;发送它,无论是该列表返回的名称还是数字id,则会改为列出该州下属的城市。响应上的level标出这次调用属于哪一种,regions或cities,因此调用方不必靠是否发送了body.region来推断。每个条目的id正是autoria-search与autoria-search-ids上body.region或body.city所期望的取值。
按名称(而不是数字id)解析body.city时,同样需要在同一次调用中发送body.region。一次调用只会返回一个层级:要获取多个州的城市列表,需要用第一次不带body.region的调用得到的每个州id分别调用一次autoria-regions,而不是靠一次调用遍历所有州。
本节涉及的字段(5)
autoria-regions, autoria-search, autoria-search-ids, body.region, body.city
AUTO.RIA 接口参考:autoria-search筛选条件及其相互作用
body.category与body.listing_type共同选择搜索AUTO.RIA哪一个目录、哪一个范围,默认为cars与used;这里的body.listing_type在autoria-listing提供的used/new之外,还多出order与all两个取值。body.model只有与body.make一起发送才会被接受,并且会在该厂商自己的车型列表范围内匹配。body.year_from与body.year_to按年款筛选;body.price_from_usd与body.price_to_usd接受0到10,000,000之间的美元价格;body.mileage_from_km与body.mileage_to_km接受0到3,000,000之间的公里里程,在AUTO.RIA应用之前会向下取整到最近的1000公里;body.engine_from_l与body.engine_to_l接受0到30之间的升排量。
body.body_type_id接受来自autoria-reference的body_types列表中的id;没有匹配车身类型的id会返回零行,而不是错误。把以上这些筛选条件全部省略并不会失败:它会逐页返回所选目录与范围下未经筛选的车辆,每页body.max_results行,按最新或最相关排在前面,而不是缩小到某个子集。
本节涉及的字段(16)
autoria-search, autoria-listing, autoria-reference, body.category, body.listing_type, body.model, body.make, body.year_from, body.year_to, body.price_from_usd, body.price_to_usd, body.mileage_from_km, body.mileage_to_km, body.engine_from_l, body.engine_to_l, body.body_type_id
autoria-search:排序、翻页与一行数据携带的内容
body.sort取relevance(默认值,不发送排序键,使用AUTO.RIA自身的排序,在自身分页之间不出现重复id)、newest(随着新广告不断出现,分页之间可能重复或跳过某一行),或price_asc/price_desc(二者顺序彼此相反,且不共享任何相同的行)。body.page的范围是1到5000,body.max_results每页1到40行,默认为第1页、20行。
除了行数据本身,data还携带total_available——这是AUTO.RIA针对所发筛选条件给出的精确总数,而不是估算值——以及该次调用所用的category、listing_type、page与sort。每一行还携带以下字段:
price_usd/uah/eur与price_currency:该列表以AUTO.RIA公布的三种货币表示的价格,并指明卖家自己使用的货币price_display_usd与price_conflict:一个单独的展示价格,以及三种货币金额互不一致时的标记mileage_km、mileage_text与mileage_conflict:里程表读数、其文本形式,以及二者不一致时的标记fuel与engine_capacity_l:驱动方式与发动机排量vin与plate_number:仅在AUTO.RIA公布时出现photo_urls[]:该列表的每一张照片地址is_sold、is_active与from_archive:该列表的售出与归档状态seller:该列表的卖家信息块
本节涉及的字段(4)
autoria-search, body.sort, body.page, body.max_results
autoria-search-ids:估算规模或翻页更经济的方式
autoria-search-ids接受与autoria-search完全相同的筛选条件,默认值与行为也相同,但data中是listing_ids而不是完整的行,旁边带有以下共用字段:
total_available:AUTO.RIA针对所发筛选条件给出的精确总数,而不是估算值returned:这一页实际返回了多少个idpage、category、listing_type与sort:这次调用自身的翻页与筛选设置,被原样返回
这里的body.max_results范围是1到100、默认100,而不是1到40、默认20,因此一次调用读取的id数量比autoria-search读取的行数更多,且无论页面大小,响应体都大约是3 KB。把它返回的listing_ids按最多25个一批发送给autoria-listings,就是把搜索的匹配结果变成完整广告详情的方式,而不必通过autoria-search本身读取每一行。
本节涉及的字段(8)
autoria-search-ids, autoria-search, autoria-listings, body.category, body.listing_type, body.sort, body.page, body.max_results
autoria-search与autoria-search-ids:部分筛选条件接受的别名
autoria-search与autoria-search-ids上的几个筛选条件接受同一取值的别名,autoria-listing与autoria-listings的id输入也接受别名:
| 字段 | 别名 |
|---|---|
body.make | brand、marka |
body.model | model_id |
body.year_from / body.year_to | year_min / year_max |
body.price_from_usd / body.price_to_usd | min_price / max_price |
body.mileage_from_km / body.mileage_to_km | min_mileage_km / max_mileage_km |
body.fuel | fuel_type |
body.gearbox | transmission |
body.region | state、oblast |
body.seller_type | seller |
body.sort | order、order_by |
body.listing_id | id、auto_id、advert_id |
body.listing_ids | ids |
本节涉及的字段(19)
autoria-search, autoria-search-ids, autoria-listing, autoria-listings, body.make, body.model, body.year_from, body.year_to, body.price_from_usd, body.price_to_usd, body.mileage_from_km, body.mileage_to_km, body.fuel, body.gearbox, body.region, body.seller_type, body.sort, body.listing_id, body.listing_ids
{
"body": {
"listing_id": "38876558"
}
}{
"body": {
"listing_ids": "38876558,40419902,40299426"
}
}{
"body": {
"category": "cars",
"make": "Audi",
"model": "Q7",
"year_from": 2018,
"year_to": 2024,
"price_from_usd": 5000,
"price_to_usd": 20000,
"fuel": "diesel",
"max_results": 20
}
}操作
公共网关操作统一使用 POST /api/v1/{project}/{action}。
使用 JSON 对象,按文档将参数放入 path、query、headers 和 body,省略未使用的位置。input.headers 是供操作使用的 JSON 数据,不是浏览器请求头。请勿在此填写凭证。按文档保留 body 的数组、标量或 null;省略与 null 含义不同。
车辆广告查询
POST /api/v1/autoria/autoria-listing
按id返回一条AUTO.RIA车辆广告的完整详情,包括价格、里程、车架号、照片与卖家信息。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.listing_id | string | 必填 | — | — | — |
body.listing_type | string | 可选 | "used" | "used""new" | — |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/autoria/autoria-listing' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"listing_id":"38876558"}}'批量广告查询
POST /api/v1/autoria/autoria-listings
一次调用最多返回25条AUTO.RIA车辆广告,按id查询,AUTO.RIA无法识别的id会单独列出。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.listing_ids | string | 必填 | — | — | — |
body.listing_type | string | 可选 | "used" | "used""new" | — |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/autoria/autoria-listings' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"listing_ids":"38876558,40419902,40299426"}}'响应字段
results[]not_found[]requestedreturned
厂商列表
POST /api/v1/autoria/autoria-makes
返回AUTO.RIA某一车辆类别下的全部厂商,并给出该厂商筛选条件可用的id。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.category | string | 可选 | "cars" | "cars""moto""water""special""trailers""trucks""buses""agricultural" | — |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/autoria/autoria-makes' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"category":"cars"}}'车型列表
POST /api/v1/autoria/autoria-models
返回AUTO.RIA某一厂商下的全部车型,并给出该车型筛选条件可用的id。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.category | string | 可选 | "cars" | "cars""moto""water""special""trailers""trucks""buses""agricultural" | — |
body.make | string | 可选 | — | — | — |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/autoria/autoria-models' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"make":"6"}}'参考列表
POST /api/v1/autoria/autoria-reference
返回AUTO.RIA自身的车辆类别、车身类型、变速箱类型或驱动类型固定列表。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.list | string | 必填 | — | "categories""body_types""gearboxes""drive_types" | — |
body.category | string | 可选 | "cars" | "cars""moto""water""special""trailers""trucks""buses""agricultural" | — |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/autoria/autoria-reference' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"list":"body_types"}}'地区与城市
POST /api/v1/autoria/autoria-regions
返回乌克兰各州,或某一州下属的城市,并给出地区与城市筛选条件可用的id。
输入字段
| 字段 | 类型 | 是否必填 | 允许的值 | 范围限制 |
|---|---|---|---|---|
body.region | string | 可选 | — | — |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/autoria/autoria-regions' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"region":"10"}}'车辆列表搜索
POST /api/v1/autoria/autoria-search
按品牌、价格、年份、里程、地区等条件搜索AUTO.RIA当前车源,返回详细行与精确匹配总数。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.accident_history | string | 可选 | — | "none""had_accident" | — |
body.auction_possible | boolean | 可选 | — | — | — |
body.body_type_id | integer | 可选 | — | — | 1–9007199254740991 |
body.category | string | 可选 | "cars" | "cars""moto""water""special""trailers""trucks""buses""agricultural" | — |
body.city | string | 可选 | — | — | — |
body.engine_from_l | number | 可选 | — | — | 0–30 |
body.engine_to_l | number | 可选 | — | — | 0–30 |
body.fuel | string | 可选 | — | "petrol""diesel""gas""gas-petrol""hybrid""electric""methane""phev""mhev""reev" | — |
body.gearbox | string | 可选 | — | "manual""automatic""tiptronic""robot""cvt""reducer" | — |
body.has_photo | boolean | 可选 | — | — | — |
body.has_video | boolean | 可选 | — | — | — |
body.listing_type | string | 可选 | "used" | "used""new""order""all" | — |
body.make | string | 可选 | — | — | — |
body.max_results | integer | 可选 | 20 | — | 1–40 |
body.mileage_from_km | integer | 可选 | — | — | 0–3000000 |
body.mileage_to_km | integer | 可选 | — | — | 0–3000000 |
body.model | string | 可选 | — | — | — |
body.page | integer | 可选 | 1 | — | 1–5000 |
body.price_from_usd | integer | 可选 | — | — | 0–10000000 |
body.price_to_usd | integer | 可选 | — | — | 0–10000000 |
body.region | string | 可选 | — | — | — |
body.seller_type | string | 可选 | — | "private""dealer" | — |
body.sort | string | 可选 | "relevance" | "relevance""newest""price_asc""price_desc" | — |
body.vin_verified | boolean | 可选 | — | — | — |
body.year_from | integer | 可选 | — | — | 1900–2030 |
body.year_to | integer | 可选 | — | — | 1900–2030 |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/autoria/autoria-search' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"category":"cars","max_results":5}}'响应字段
results[]total_availablereturnedpagecategorylisting_typesort
车辆列表id搜索
POST /api/v1/autoria/autoria-search-ids
执行与车辆列表搜索相同的筛选,但只返回匹配的id与总数,适合统计规模或翻页浏览大量结果。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.accident_history | string | 可选 | — | "none""had_accident" | — |
body.auction_possible | boolean | 可选 | — | — | — |
body.body_type_id | integer | 可选 | — | — | 1–9007199254740991 |
body.category | string | 可选 | "cars" | "cars""moto""water""special""trailers""trucks""buses""agricultural" | — |
body.city | string | 可选 | — | — | — |
body.engine_from_l | number | 可选 | — | — | 0–30 |
body.engine_to_l | number | 可选 | — | — | 0–30 |
body.fuel | string | 可选 | — | "petrol""diesel""gas""gas-petrol""hybrid""electric""methane""phev""mhev""reev" | — |
body.gearbox | string | 可选 | — | "manual""automatic""tiptronic""robot""cvt""reducer" | — |
body.has_photo | boolean | 可选 | — | — | — |
body.has_video | boolean | 可选 | — | — | — |
body.listing_type | string | 可选 | "used" | "used""new""order""all" | — |
body.make | string | 可选 | — | — | — |
body.max_results | integer | 可选 | 100 | — | 1–100 |
body.mileage_from_km | integer | 可选 | — | — | 0–3000000 |
body.mileage_to_km | integer | 可选 | — | — | 0–3000000 |
body.model | string | 可选 | — | — | — |
body.page | integer | 可选 | 1 | — | 1–5000 |
body.price_from_usd | integer | 可选 | — | — | 0–10000000 |
body.price_to_usd | integer | 可选 | — | — | 0–10000000 |
body.region | string | 可选 | — | — | — |
body.seller_type | string | 可选 | — | "private""dealer" | — |
body.sort | string | 可选 | "relevance" | "relevance""newest""price_asc""price_desc" | — |
body.vin_verified | boolean | 可选 | — | — | — |
body.year_from | integer | 可选 | — | — | 1900–2030 |
body.year_to | integer | 可选 | — | — | 1900–2030 |
请求示例
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/autoria/autoria-search-ids' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"category":"cars","make":"6","max_results":50}}'响应字段
listing_ids[]total_availablereturnedpagecategorylisting_typesort
调用方式
- 使用
POST /api/v1/autoria/<action>,并携带x-api-key、Content-Type: application/json和必需的Idempotency-Key。 - 调用成功时返回
ok: true:data是操作的结果,meta.requestId标识已记录的请求,meta.chargedCreditUnits是实际扣费金额。否则ok为false,error.code说明原因;请读取ok和error.code,不要只依赖 HTTP 状态码。每个网关响应都带有供支持使用的请求 ID:meta.requestId;没有meta的响应(如受理前被拒绝)则为顶层requestId。 - 只有调用成功才按标价扣费。失败不扣费;结果无法确认时,最多 900 秒后释放,不扣费。
- 请求完成后,以同一个 Idempotency-Key 重复发送相同请求,24 小时内返回已保存的响应,不会再次扣费。
网关调用参考: