# Thefork (Italy) — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search and discover Italian restaurants by cuisine, location, or ratings, then access detailed information like menus, reviews, and availability across major cities in Italy. Find top-rated dining options and compare restaurant details to plan your perfect meal.

**Category:** Food & Dining | **Website:** [thefork.it/](https://thefork.it/) | **Docs:** [parse.bot/marketplace/a4e0eadc-4965-4d37-869b-524381640f65/thefork-it-api](https://parse.bot/marketplace/a4e0eadc-4965-4d37-869b-524381640f65/thefork-it-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-thefork-it-api-a4e0eadc/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_cities

Returns the list of supported Italian cities with their IDs and slugs. Use the returned id and slug values as inputs for search_restaurants and get_top_rated_restaurants. The city set is stable (major Italian cities served by TheFork).

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-thefork-it-api-a4e0eadc/get_cities \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_restaurant_details

Get full details for a specific restaurant including description, tags, and top 10 reviews with ratings and reviewer names. Use slug and legacyId values from search_restaurants results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `restaurant_id` | string | Yes | Restaurant legacy numeric ID as a string, from the legacyId field in search_restaurants results. |
| `slug` | string | Yes | Restaurant slug from search_restaurants results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-thefork-it-api-a4e0eadc/get_restaurant_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"restaurant_id":"<string>","slug":"<string>"}'
```

### get_top_rated_restaurants

Retrieve the top rated restaurants in a city, sorted by rating descending. Fetches available restaurants and returns the highest-rated ones up to the specified limit.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `city_id` | string | No | City ID from get_cities endpoint. Must correspond to city_slug. |
| `city_slug` | string | No | City slug from get_cities endpoint. Must correspond to city_id. |
| `limit` | integer | No | Maximum number of top-rated restaurants to return. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-thefork-it-api-a4e0eadc/get_top_rated_restaurants \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"city_id":"<string>","city_slug":"<string>","limit":"<integer>"}'
```

### search_restaurants

Search for restaurants in a city by city ID and slug. Returns up to 25 restaurants with ratings, addresses, and average prices. Use get_cities to discover valid city_id and city_slug values.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `city_id` | string | No | City ID from get_cities endpoint. Must correspond to city_slug. |
| `city_slug` | string | No | City slug from get_cities endpoint. Must correspond to city_id. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-thefork-it-api-a4e0eadc/search_restaurants \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"city_id":"<string>","city_slug":"<string>"}'
```
