# TripAdvisor 关键词搜索 API (tripadvisor.search)

- Canonical page: [https://everyinfra.com/tripadvisor-api/search](https://everyinfra.com/tripadvisor-api/search?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "tripadvisor", "action": "search", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 10, max 30 per call
- Mode: sync; add "mode": "async" for slow tasks

TripAdvisor 关键词搜索用 `keyword` 一次检索酒店、餐厅和景点三类地点，默认 10 条，单次最多 30 条。每行是一个候选：名字、分类、评分与满分、点评数量、价格档位、名次、地址、电话和坐标。只知道目的地或店名时，先用它列出候选；也适合把自家名单上的店对到 TripAdvisor 条目，或者横向比较一座城市里的几家餐厅。

`keyword` 填地点名，同名的多就带上城市，示例用的是 Kyoto 这样的目的地；它不搜评论全文。评价接口需要具体地点作为目标，所以先在这里定位，再把那一行的 `url` 交给评价接口或详情接口。`content_type`、`currency`、`lang` 三个可选参数在详情那一页含义相同。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=tripadvisor&action=search

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | yes | not declared | search 混合检索酒店、餐厅与景点；restaurants 只查餐厅，attractions 只查景点。填写地点名并附城市有助区分同名地点，不是评论全文搜索。 |
| content_type | enum: from_everyone / from_management / from_travelers | no | not declared | search / profile / restaurants / attractions 的地点照片来源：from_everyone 全部、from_management 商家上传、from_travelers 游客上传；不是酒店/餐厅/景点对象类型，请选对应 action。 |
| currency | enum: aed / afn / all / amd / ars / aud / azn / bam / bdt / bgn / bhd / bif / bnd / bob / brl / bwp / byn / bzd / cad / cdf / chf / clp / cny / cop / crc / cve / czk / djf / dkk / dop / dzd / eek / egp / ern / etb / eur / gbp / gel / ghs / gnf / gtq / hkd / hnl / hrk / huf / idr / ils / inr / iqd / irr / isk / jmd / jod / jpy / kes / khr / kmf / krw / kwd / kzt / lbp / lkr / ltl / lvl / lyd / mad / mdl / mga / mkd / mmk / mop / mur / mxn / myr / mzn / nad / ngn / nio / nok / npr / nzd / omr / pab / pen / php / pkr / pln / pyg / qar / ron / rsd / rub / rwf / sar / sdg / sek / sgd / sos / syp / thb / tnd / top / try / ttd / twd / tzs / uah / ugx / usd / uyu / uzs / vef / vnd / xaf / xof / yer / zar / zmk / zwl | no | not declared | 地点展示价格的币种，默认 usd；常用 eur 欧元、gbp 英镑、cny 人民币。允许值的完整清单保留不变，但并不意味着每种历史代码都有实时价格；不是 API 结算币种。 |
| lang | enum: aa / ab / ae / af / ak / am / an / ar / as / av / ay / az / ba / be / bg / bh / bi / bm / bn / bo / br / bs / ca / ce / ch / co / cr / cs / cu / cv / cy / da / de / dv / ee / el / en / eo / es / et / eu / fa / ff / fi / fj / fo / fr / fy / ga / gd / gl / gn / gu / gv / ha / he / hi / ho / hr / ht / hu / hy / hz / ia / id / ie / ig / ii / ik / io / is / it / iu / iw / ja / jv / ka / kg / ki / kj / kk / kl / km / kn / ko / kr / ks / ku / kv / kw / ky / la / lb / lg / li / ln / lo / lt / lu / lv / mg / mh / mi / mk / ml / mn / mr / ms / mt / my / na / nb / nd / ne / ng / nl / nn / no / nr / nv / ny / oc / oj / om / or / os / pa / pi / pl / ps / pt / qu / rm / rn / ro / ru / rw / sa / sc / sd / se / sg / si / sk / sl / sm / sn / so / sq / sr / ss / st / su / sv / sw / ta / te / tg / th / ti / tk / tl / tn / to / tr / ts / tt / tw / ty / ug / uk / ur / uz / ve / vi / vo / wa / wo / xh / yi / yo / za / zh | no | not declared | search / profile / restaurants / attractions 的地点展示语言，使用两字母语言码，例如 en 英语、zh 中文；reviews 不接受这个参数。 |
| limit | integer (1–30) | no | 10 | 这次调用最多返回的条数，整数，1–30；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| category | 分类名称，取值为原平台的分类体系，未做跨平台归一。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| rating | 评分。**分制随平台而异**，同一行的 `rating_scale` 给出该平台满分 (多数是 5，Booking/豆瓣/爱奇艺/NAVER 是 10)。跨平台比较前必须先按 rating_scale 换算。直接比数字会得出反的结论。 |
| rating_scale | 上一列 `rating` 的满分。5 表示五星制、10 表示十分制。只在该行有 rating 时出现。 |
| review_count | 评价条数，用于商品/商家类能力。null 表示不公开，不等于 0。 |
| price_level | 价格档位，用 $ 数量表示（$ 到 $$$$），不是具体金额。 |
| ranking | 在同城同类中的排名（如「本市餐厅第 3 名」）。 |
| address | 详细地址，原文透传。 |
| city | 城市名，用原平台的语言书写，未做中英归一。 |
| country | 国家或地区。可能是全称也可能是 ISO 代码，取决于平台，未归一。 |
| location | 地理位置描述，原文透传，格式随平台而异。 |
| phone | 联系电话，原文透传，未做号码格式归一。 |
| email | 商家公开邮箱。 |
| website | 账号或商家填写的外链网址。 |
| latitude | 纬度。 |
| longitude | 经度。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| cuisines | platform-native meaning |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "tripadvisor",
  "action": "search",
  "params": {
    "keyword": "Kyoto"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "tripadvisor",
        "action": "search",
        "params": {
            "keyword": "Kyoto",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-10-24T18:28:34Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 10. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "tripadvisor",
  "action": "search",
  "results": [
    {
      "id": "23101005",
      "name": "Park Hotel Kyoto Oike",
      "category": "hotel",
      "url": "https://www.tripadvisor.com/Hotel_Review-g298564-d23101005-Reviews-Park_Hotel_Kyoto_Oike-Kyoto_Kyoto_Prefecture_Kinki.html",
      "rating": 4.8,
      "review_count": 184,
      "price_level": "$",
      "ranking": "#12 of 356 hotels in Kyoto",
      "address": "180 Nishiyokocho, Oikedori Muromachi Nishiiru, Kyoto, Kyoto Prefecture 604-0023",
      "city": "Kyoto",
      "country": "JP",
      "location": "Kyoto, Kyoto Prefecture",
      "website": "https://www.parkhotelgroup.com/park-hotel-kyoto",
      "latitude": 35.01113,
      "longitude": 135.7574,
      "image_url": "https://media-cdn.tripadvisor.com/media/photo-o/33/0a/f3/c0/caption.jpg",
      "platform": "tripadvisor",
      "rating_scale": 5
    },
    {
      "id": "558353",
      "name": "NISHIYAMA RYOKAN",
      "category": "hotel",
      "url": "https://www.tripadvisor.com/Hotel_Review-g298564-d558353-Reviews-NISHIYAMA_RYOKAN-Kyoto_Kyoto_Prefecture_Kinki.html",
      "rating": 4.6,
      "review_count": 752,
      "price_level": "$$",
      "ranking": "#4 of 346 B&Bs / Inns in Kyoto",
      "address": "433 Gokomachi St, Sagaru, Nakagyo-Ku, Kyoto, Kyoto Prefecture 604-0933",
      "city": "Kyoto",
      "country": "JP",
      "location": "Kyoto, Kyoto Prefecture",
      "website": "https://www.ryokan-kyoto.com/",
      "latitude": 35.01302,
      "longitude": 135.76639,
      "image_url": "https://media-cdn.tripadvisor.com/media/photo-o/32/2c/4b/7e/caption.jpg",
      "platform": "tripadvisor",
      "rating_scale": 5
    }
  ],
  "count": 10,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 结果里酒店、餐厅、景点混在一起，怎么分开？

看每行的 `category`，它是 TripAdvisor 自己的分类名，没有跨平台归一。只要餐厅或只要景点，直接改用餐厅、景点那两项能力，比在混合结果里筛更直接。三类都要时留在这里，一次最多 30 条；目标明确时把关键词写成店名加城市，同名地点更容易分开。

### 能用 `keyword` 搜到提到某道菜的评论吗？

不能，`keyword` 匹配的是地点，不是评论全文。评价接口要一个具体地点的链接，流程是先在这里搜出地点，挑中后把它的 `url` 交过去读评价。拿店名对条目时，同一个名字可能对出几行，用 `address`、`latitude` 和 `longitude` 核对是不是你要的那一家，再记下它的 `id`。

### 几家餐厅的评分怎么放在一起比？

先看同一行的 `rating_scale`：5 是五星制，10 是十分制，换算成同一分制再比。分数接近的，再看 `review_count`；它为 null 是没公开，别当成 0 排在最后。`ranking` 是同城同类里的名次，例如本市餐厅第 3 名，只能和同一城市、同一类的地点比，跨城市比名次没有意义。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=tripadvisor
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
