开发文档
Avito.ru API 技术参考:广告搜索与广告记录
Avito.ru API 参考:说明关键词、类目与筛选条件的行为,搜索行和广告记录的返回字段,以及地点、类目与联想查询的用法。
另见: Avito.ru 分类广告数据 API 概览与价格 · Avito.ru API 指南:搜索、广告详情与地点
本页内容
Avito.ru API 搜索输入:地点、类目与查询词如何组合
在 avito-search 中,关键词与类目是配合关系而不是互相替代。body.query 按 Avito 搜索框的方式解读,所以关键词可以用俄语或拉丁字母书写,body.category 则把同一个查询收窄到类目树的某个分支。类目可以是节点 id、俄语名称,或来自 avito-categories 的路径,例如 telefony/mobilnye_telefony。
body.location 接受来自 avito-locations 的 slug、Москва 这样的大城市名称,或用 all 在整个俄罗斯范围内搜索。由于 Avito 会把关键词转换为类目加筛选条件,body.category_detection 决定是否发生这种转换,query_interpreted_as 则连同一条 note 报告所用的类目路径。
本节涉及的字段(5)
avito-search, body.query, body.location, body.category, body.category_detection
搜索结果的排序与翻页
body.sort 改变一页中各行的顺序。relevance 沿用 Avito 自己的顺序并把付费行放在最前,discount 仅限 avito-search,对商品把降价幅度最大的行放在最前。
一页容纳 50 行,Avito 在第 30 页之后不再提供结果,因此一次查询逐页读取的窗口是 1,500 行。超出这个窗口的页码不在操作期望的范围内。has_more 显示窗口之内后面是否还有一页。
本节涉及的字段(5)
avito-search, avito-cars-search, avito-real-estate-search, body.sort, body.page
搜索返回值中除行以外的内容
除 listings 外,data 还带有读取一页所需的计数。count 显示本页有多少行,total 显示共有多少匹配,pageable_total 显示其中翻页能够到达多少。
page 与 has_more 给出在窗口中的位置,sort_applied、filters_applied 与 location 重复搜索实际使用的条件。search_url 保存该次搜索本身的 URL。
sponsored_dropped 统计从本页移除的付费行,promoted_on_page 统计本页出现的付费行。通过 body.include_sponsored 保留这些行时,它们以 is_promoted 标示。
本节涉及的字段(5)
avito-search, avito-cars-search, avito-real-estate-search, data, body.include_sponsored
Avito.ru 搜索行内的数组
搜索行内含若干数组。location 内的 nearby 保存广告附近的地点,例如房产行中带步行时间的地铁站。
images 保存广告的图片,badges 出现在行本身和 seller 内,表示随广告或卖家显示的标签。seller 内的 info 补充更多卖家信息。
reseller_reasons 给出 reseller_likely 背后的理由,paid_services 列出 is_promoted 行所用的付费推广服务。fallback_results 保存 Avito 在无结果时用来补位的无关广告,avito-search 的 body.include_fallback_results 会把它们送到这里。
本节涉及的字段(4)
avito-search, avito-cars-search, avito-real-estate-search, body.include_fallback_results
Avito Auto 中依赖品牌的筛选条件
avito-cars-search 读取 Avito Auto。body.make 是 Avito 链接中书写的品牌,例如 toyota。
body.model 是车型 slug,例如 camry。车型、年份、里程、燃料、驱动和卖家这些输入都依赖 body.make。
里程边界以公里计,body.condition 选择二手车或新车。body.fuel 与 body.drive 是数组,所以一次请求可以列出多个值:
body.fuel取petrol、diesel、gas、hybrid和electricbody.drive取front、rear和all_wheel
body.sort 另有 year_desc(车款年份最新的在前)和 mileage_asc(里程最低的在前)。各行带有 params_summary,含发动机、功率、变速箱、驱动和车身信息,经销商的行可以通过 price_is_from 给出起步价,并与 price_before_discount 并列。
本节涉及的字段(12)
avito-cars-search, body.make, body.model, body.condition, body.year_min, body.year_max, body.mileage_min, body.mileage_max, body.fuel, body.drive, body.seller_type, body.sort
Avito.ru 房产搜索:交易与物业类型的选择
body.transaction 选择交易方式。sale、rent_long 与 rent_daily 分别对应出售、长租和日租,rent 则合并两种租赁,适用于土地、车库和商业地产。
body.property_type 切换所搜索的物业种类,body.rooms、body.area_min 与 body.area_max 适用于公寓。body.rooms 接受由 studio、1 到 9 的数量、10_plus 和 open_plan 组成的数组,所以可以同时搜索开间和两居室。
body.market 在出售的公寓中区分 secondary 二手房与 new_build 新建楼盘。body.seller_type 随交易方式而变:出售时为 private、developer 或 agency,出租时为 owner 或 agency。每一行的 realty_type 显示 category_type、transaction_type 和 rent_term,development_name 给出住宅小区名称,price_per_unit 给出每平方米价格。
本节涉及的字段(8)
avito-real-estate-search, body.transaction, body.property_type, body.rooms, body.area_min, body.area_max, body.market, body.seller_type
Avito.ru 广告记录:listing 的各个块
avito-listing 通过广告链接末尾的数字或完整链接查找一条广告。listing 对象以 ad_id、title、url 和 status 开头。
closed_status_text 说明已关闭的广告,随后是价格字段、published_or_raised_text、expires_at 和完整的 description。category 与 breadcrumbs 给出广告的类目及其路径,images 与 images_count 保存图片及其数量。
其余字段分块排列:
params:每个参数,由attribute_id、name和value组成param_groups:把相关参数归入building、rent_terms、house_rules、requirements等分组vehicle与property:汽车和房产的概要,market_estimate位于property内location:地址,以及district和nearby附近地点coordinates:以lat和lng表示的位置,附带precision以及radius_m中的半径views:total浏览总数和today当天的浏览数
本节涉及的字段(3)
avito-listing, body.ad_id, data
Avito.ru 广告记录:卖家块
avito-listing 的 seller 块比搜索行多出若干字段。它给出 shop_name 和 contact_person,并用 on_avito_since 与 YYYY-MM 格式的 on_avito_since_date 表示卖家入驻 Avito 的时间。reply_time 描述卖家回复的快慢,is_verified 与 inn_verified 描述认证情况,phone_available 与 phone_masked 描述电话联系方式。
在 seller 之外,记录以 delivery_available 与 is_reserved 收尾,它们显示是否提供 Avito Delivery,以及商品是否已被预订。
本节涉及的字段(2)
avito-listing, data
Avito.ru 类目树及其路径
avito-categories 在 categories 中返回类目树。类目树有 591 个节点,涵盖交通工具、房产、招聘、服务、电子产品、家居、时尚、爱好、动物和商业,名称为俄语。level 给出节点的层级深度,parent_node_id 指向其父节点,因此可以根据列表重建层级结构。
类目路径是 avito-search 的 body.category 接受的形式之一,与 node_id 和俄语 name 并列。body.query 按类目名称或路径过滤列表,count 报告返回了多少个节点。
本节涉及的字段(2)
avito-categories, body.query
Avito.ru 地点查询与城市 slug
avito-locations 把地名转换成搜索所用的取值。俄语写法如 казань 或转写拼写均可,城镇和地区都能匹配,至少需要 2 个字母。
locations 中的每一项返回 body.location 所取的 slug。它还给出 name、地点所属的 region 和 location_id,count 报告条目数量。
本节涉及的字段(2)
avito-locations, body.query
Avito.ru 搜索联想
avito-suggest 对应用户输入时 Avito 搜索框显示的联想。发送的文字可以是没写完的词,例如 айфо,长度限制为 64 个字符。
suggestions 中的每一项把它补全为一个 query,并附上 Avito 对该联想应用的 category_id 和 filters。related_words 列出与输入文字相关的词,count 报告联想数量。
本节涉及的字段(2)
avito-suggest, body.query
多个 Avito.ru 操作共用的输入
body.include_pii 设为 true 时,才会返回个人卖家的姓名、录入地址和精确坐标,avito-search、avito-cars-search、avito-real-estate-search 和 avito-listing 默认不返回它们。隐藏期间,行上的 name_withheld 与 coordinates_withheld 会显示这一点。
body.max_rotations 设定 Avito 拒绝一次调用时追加尝试的次数,0 表示采用默认的尝试次数。除 avito-categories 外,各操作都有该输入;范围之外的取值会被忽略,改用默认值。
本节涉及的字段(8)
avito-search, avito-cars-search, avito-real-estate-search, avito-listing, avito-locations, avito-suggest, body.include_pii, body.max_rotations
操作
公共网关操作统一使用 POST /api/v1/{project}/{action}。
使用 JSON 对象,按文档将参数放入 path、query、headers 和 body,省略未使用的位置。input.headers 是供操作使用的 JSON 数据,不是浏览器请求头。请勿在此填写凭证。按文档保留 body 的数组、标量或 null;省略与 null 含义不同。
汽车搜索
POST /api/v1/avito/avito-cars-search
用汽车专属的筛选条件搜索 Avito Auto 的二手车和新车。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.condition | string | 可选 | — | "used""new" | — |
body.drive | string[] | 可选 | — | "rear""front""all_wheel" | — |
body.fuel | string[] | 可选 | — | "petrol""gas""hybrid""diesel""electric" | — |
body.include_pii | boolean | 可选 | false | — | — |
body.include_sponsored | boolean | 可选 | false | — | — |
body.location | string | 可选 | "all" | — | — |
body.make | string | 可选 | — | — | — |
body.max_rotations | integer | 可选 | 0 | — | 0–20 |
body.mileage_max | integer | 可选 | — | — | 0–9007199254740991 |
body.mileage_min | integer | 可选 | — | — | 0–9007199254740991 |
body.model | string | 可选 | — | — | — |
body.page | integer | 可选 | 1 | — | 1–30 |
body.price_max | integer | 可选 | — | — | 0–9007199254740991 |
body.price_min | integer | 可选 | — | — | 0–9007199254740991 |
body.query | string | 可选 | — | — | — |
body.seller_type | string | 可选 | — | "private""company" | — |
body.sort | string | 可选 | "newest" | "newest""relevance""price_asc""price_desc""year_desc""mileage_asc" | — |
body.year_max | integer | 可选 | — | — | 1900–2100 |
body.year_min | integer | 可选 | — | — | 1900–2100 |
请求示例
# 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/avito/avito-cars-search' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"location":"moskva","make":"toyota"}}'响应字段
listings[]ad_idtitleurlcategorycategory_idnameslugroot_category_id
subtitlepriceprice_minprice_maxprice_is_fromcurrencyprice_textprice_periodis_freeprice_not_publishedprice_before_discountdiscount_percentprice_loweredprice_per_unitvalueunit
published_atlocationlocation_idnameaddressnearby[]slugname_source
coordinateslatlngprecision
coordinates_withheldaddress_as_typedsellertypetype_labelhas_shopnamename_withheldname_hidden_by_avitoprofile_idprofile_urlratingrating_scalereviews_countclosed_ads_countreseller_likelyreseller_reasons[]info[]badges[]
images[]images_counthas_videodescription_snippetparams_summarybadges[]development_namerealty_typecategory_typetransaction_typerent_term
is_promotedpaid_services[]is_xlis_reserveddelivery_availabledelivery_textis_verified_item
counttotalpageable_totalpagehas_moresort_appliedlocationfilters_appliedquery_interpreted_ascategory_pathnote
sponsored_droppedpromoted_on_pagefallback_results_droppedfallback_results[]search_url
类目树
POST /api/v1/avito/avito-categories
列出 Avito.ru 的类目,含节点 id 和搜索可用的路径。
输入字段
| 字段 | 类型 | 是否必填 | 允许的值 | 范围限制 |
|---|---|---|---|---|
body.query | 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/avito/avito-categories' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"query":"диван"}}'响应字段
categories[]node_idcategory_idnamepathlevelparent_node_id
countsource
广告详情
POST /api/v1/avito/avito-listing
按 id 或链接读取单条广告的参数、卖家信息和浏览量。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.ad_id | string | 必填 | — | — | — |
body.include_pii | boolean | 可选 | false | — | — |
body.max_rotations | integer | 可选 | 0 | — | 0–20 |
请求示例
# 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/avito/avito-listing' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"ad_id":"8341164961"}}'地点查询
POST /api/v1/avito/avito-locations
查找俄罗斯城市、城镇或地区对应的地点 slug 与 id。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.query | string | 必填 | — | — | — |
body.max_rotations | integer | 可选 | 0 | — | 0–20 |
请求示例
# 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/avito/avito-locations' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"query":"диван"}}'响应字段
locations[]slugnameregionlocation_idsource
count
房产搜索
POST /api/v1/avito/avito-real-estate-search
搜索出售或出租的公寓、房间、住宅、土地、车库和商业地产。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.transaction | string | 必填 | — | "sale""rent_long""rent_daily""rent" | — |
body.area_max | integer | 可选 | — | — | 0–9007199254740991 |
body.area_min | integer | 可选 | — | — | 0–9007199254740991 |
body.include_pii | boolean | 可选 | false | — | — |
body.include_sponsored | boolean | 可选 | false | — | — |
body.location | string | 可选 | "all" | — | — |
body.market | string | 可选 | — | "secondary""new_build" | — |
body.max_rotations | integer | 可选 | 0 | — | 0–20 |
body.page | integer | 可选 | 1 | — | 1–30 |
body.price_max | integer | 可选 | — | — | 0–9007199254740991 |
body.price_min | integer | 可选 | — | — | 0–9007199254740991 |
body.property_type | string | 可选 | "apartment" | "apartment""room""house""land""garage""commercial" | — |
body.query | string | 可选 | — | — | — |
body.rooms | string[] | 可选 | — | 12 个值"1""2""3""4""5""6""7""8""9""studio""10_plus""open_plan" | — |
body.seller_type | string | 可选 | — | "private""developer""agency""owner" | — |
body.sort | string | 可选 | "newest" | "newest""relevance""price_asc""price_desc" | — |
请求示例
# 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/avito/avito-real-estate-search' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"location":"sankt-peterburg","transaction":"rent_long"}}'响应字段
listings[]ad_idtitleurlcategorycategory_idnameslugroot_category_id
subtitlepriceprice_minprice_maxprice_is_fromcurrencyprice_textprice_periodis_freeprice_not_publishedprice_before_discountdiscount_percentprice_loweredprice_per_unitvalueunit
published_atlocationlocation_idnameaddressnearby[]slugname_source
coordinateslatlngprecision
coordinates_withheldaddress_as_typedsellertypetype_labelhas_shopnamename_withheldname_hidden_by_avitoprofile_idprofile_urlratingrating_scalereviews_countclosed_ads_countreseller_likelyreseller_reasons[]info[]badges[]
images[]images_counthas_videodescription_snippetparams_summarybadges[]development_namerealty_typecategory_typetransaction_typerent_term
is_promotedpaid_services[]is_xlis_reserveddelivery_availabledelivery_textis_verified_item
counttotalpageable_totalpagehas_moresort_appliedlocationfilters_appliedquery_interpreted_ascategory_pathnote
sponsored_droppedpromoted_on_pagefallback_results_droppedfallback_results[]search_url
广告搜索
POST /api/v1/avito/avito-search
按关键词、类目、地点、价格和卖家类型搜索任意类目的广告。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.category | string | 可选 | — | — | — |
body.category_detection | boolean | 可选 | true | — | — |
body.delivery_only | boolean | 可选 | — | — | — |
body.include_fallback_results | boolean | 可选 | false | — | — |
body.include_pii | boolean | 可选 | false | — | — |
body.include_sponsored | boolean | 可选 | false | — | — |
body.location | string | 可选 | "all" | — | — |
body.max_rotations | integer | 可选 | 0 | — | 0–20 |
body.page | integer | 可选 | 1 | — | 1–30 |
body.price_max | integer | 可选 | — | — | 0–9007199254740991 |
body.price_min | integer | 可选 | — | — | 0–9007199254740991 |
body.query | string | 可选 | — | — | — |
body.seller_type | string | 可选 | — | "private""company" | — |
body.sort | string | 可选 | "newest" | "newest""relevance""price_asc""price_desc""discount" | — |
请求示例
# 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/avito/avito-search' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"location":"moskva","query":"диван"}}'响应字段
listings[]ad_idtitleurlcategorycategory_idnameslugroot_category_id
subtitlepriceprice_minprice_maxprice_is_fromcurrencyprice_textprice_periodis_freeprice_not_publishedprice_before_discountdiscount_percentprice_loweredprice_per_unitvalueunit
published_atlocationlocation_idnameaddressnearby[]slugname_source
coordinateslatlngprecision
coordinates_withheldaddress_as_typedsellertypetype_labelhas_shopnamename_withheldname_hidden_by_avitoprofile_idprofile_urlratingrating_scalereviews_countclosed_ads_countreseller_likelyreseller_reasons[]info[]badges[]
images[]images_counthas_videodescription_snippetparams_summarybadges[]development_namerealty_typecategory_typetransaction_typerent_term
is_promotedpaid_services[]is_xlis_reserveddelivery_availabledelivery_textis_verified_item
counttotalpageable_totalpagehas_moresort_appliedlocationfilters_appliedquery_interpreted_ascategory_pathnote
sponsored_droppedpromoted_on_pagefallback_results_droppedfallback_results[]search_url
搜索联想
POST /api/v1/avito/avito-suggest
返回 Avito 对未输入完整的查询给出的联想词,附类目与筛选条件。
输入字段
| 字段 | 类型 | 是否必填 | 默认值 | 允许的值 | 范围限制 |
|---|---|---|---|---|---|
body.query | string | 必填 | — | — | — |
body.max_rotations | integer | 可选 | 0 | — | 0–20 |
请求示例
# 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/avito/avito-suggest' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"query":"диван"}}'响应字段
suggestions[]querycategory_idfilters
related_words[]count
调用方式
- 使用
POST /api/v1/avito/<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 小时内返回已保存的响应,不会再次扣费。
网关调用参考: