# Tayara — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/tayara/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## 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.beta.paywithlocus.com/api/wrapped/credits/tayara/get-ad-detail \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/tayara/get-categories \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/tayara/list-ads \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/tayara/list-shops \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/tayara/search-ads \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","offset":"<integer>","query":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.