# tripadvisor-content

Tripadvisor Content API. Read-only for reviews; like Yelp, Tripadvisor does not expose a programmatic response-posting API for non-partner accounts.

## What we use

- **Location search:** `GET /api/partner/2.0/location/search?query=<name>&category=<category>&address=<addr>`
- **Location detail:** `GET /api/partner/2.0/location/{loc-id}/details`
- **Reviews:** `GET /api/partner/2.0/location/{loc-id}/reviews?limit=50&offset=<n>&language=en`

## Reviews

- Returns the public review feed per location, paginated. Cursor stored as `offset`.
- Most-recent-first ordering by default.
- Photos are returned as URLs; we do not store them.

## Auth

Tripadvisor Content API key in `TRIPADVISOR_API_KEY` environment variable. Pass as `key` query param per their convention.

## Rate limits

- 50 calls per second per key.
- 5,000 calls per day on the free Content API tier.
- We poll every 10 minutes per connected location (~144 calls/day per location). 30+ locations per key gets tight; shard by tenant.

## Failure modes

- **400 INVALID_LOCATION:** match failed. Re-search UI.
- **403:** key revoked or rate-limited. Back off; alert engineer.

## Response posting

No programmatic responses on the Content API. The response-drafter generates a draft; app deep-links to `https://www.tripadvisor.com/Owners-?detail=<loc-id>&content=<draft>` (the param surface varies; we keep the deep-link helper updated).

## Compliance

Tripadvisor's owner-response guidelines explicitly recommend short, courteous, non-defensive language. The response-drafter respects these.

## Not done in CL-002

The Content adapter is not yet implemented. Ships in a later CL.
