# Tayara — 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 browse listings on Tayara.tn to find products, view seller contact information, and explore shop details and categories. Get comprehensive details about specific ads including pricing, descriptions, and seller information to make informed purchasing decisions.

**Category:** Marketplaces | **Website:** [tayara.tn/](https://tayara.tn/) | **Docs:** [parse.bot/marketplace/e5be563b-e85d-4a65-a307-6e16e1d91ff6/tayara-tn-api](https://parse.bot/marketplace/e5be563b-e85d-4a65-a307-6e16e1d91ff6/tayara-tn-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-tayara-tn-api-e5be563b/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_ad_detail

Retrieve full details of a specific classified ad including the seller's phone number, category-specific parameters (e.g. vehicle color, year, fuel type), publisher information, and high-resolution images. The ad_id can be obtained from search_ads or list_ads results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `ad_id` | string | Yes | The unique ID of the ad. Obtain from search_ads or list_ads results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tayara-tn-api-e5be563b/get_ad_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ad_id":"<string>"}'
```

### get_categories

Retrieve the main category listing and recent/featured ads from the Tayara.tn homepage. Category IDs returned here can be used with the list_ads endpoint to filter by category.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tayara-tn-api-e5be563b/get_categories \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### list_ads

List classified ads with advanced filters for category, location, and price range. Supports filtering by governorate, delegation, category ID, sub-category ID, and min/max price. Paginates via offset. Category IDs can be obtained from the get_categories endpoint.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_id` | string | No | Category ID to filter by (e.g. '60be84bc50ab95b45b08a094' for Véhicules). Obtain from get_categories endpoint. |
| `delegation` | string | No | Delegation name to filter by (e.g. 'Hammam Chott'). |
| `governorate` | string | No | Governorate name to filter by (e.g. 'Ben Arous', 'Sfax'). |
| `limit` | integer | No | Number of results per page. |
| `max_price` | integer | No | Maximum price filter. 0 means no maximum. |
| `min_price` | integer | No | Minimum price filter. 0 means no minimum. |
| `offset` | integer | No | Pagination offset (number of results to skip). |
| `sub_category_id` | string | No | Sub-category ID to filter by. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tayara-tn-api-e5be563b/list_ads \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category_id":"<string>","delegation":"<string>","governorate":"<string>","limit":"<integer>","max_price":"<integer>","min_price":"<integer>","offset":"<integer>","sub_category_id":"<string>"}'
```

### list_shops

List all active shops (boutiques) on the Tayara.tn platform with their contact information, addresses, and descriptions. Returns the full directory in a single page.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tayara-tn-api-e5be563b/list_shops \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_ads

Full-text search over Tayara.tn classified ads. query matches title and description; results are sorted by recency. Paginates via offset. Each listing includes id, title, description, images, price, metadata (publisher, publish date, subcategory), and location (governorate, delegation).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of results per page. |
| `offset` | integer | No | Pagination offset (number of results to skip). |
| `query` | string | No | Search keyword (e.g. 'voiture'). Omitting returns all recent ads. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-tayara-tn-api-e5be563b/search_ads \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","offset":"<integer>","query":"<string>"}'
```
