# Playtomic — 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 explore sports clubs on Playtomic. Find clubs by name or location, retrieve court details and opening hours, check real-time slot availability, and calculate court utilization across multiple days.

**Category:** Sports | **Website:** [playtomic.com/](https://playtomic.com/) | **Docs:** [parse.bot/marketplace/53867326-d99f-4555-b855-7c2e6690592a/playtomic-com-api](https://parse.bot/marketplace/53867326-d99f-4555-b855-7c2e6690592a/playtomic-com-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-playtomic-com-api-53867326/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### fetch_utilisation

Calculate detailed court utilization (available vs not available) in 30-minute increments for a club over a specified number of days. Searches for the club by name, retrieves court details and availability, then generates a status record for every court at every 30-minute time slot within opening hours. Combines search, detail, and availability calls internally — a single call returns the full matrix.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `days` | integer | No | Number of days to check (1 to 7) |
| `query` | string | Yes | Club name to search for (e.g. 'City Tennis Club', 'Madrid Central Pádel') |
| `sport_id` | string | No | Sport filter. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-playtomic-com-api-53867326/fetch_utilisation \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"days":"<integer>","query":"<string>","sport_id":"<string>"}'
```

### get_court_availability

Fetch available booking slots for a specific club on a given date. Returns all available slots grouped by resource/court, including start time, duration, and price. The upstream API returns all duration variants (e.g. 60, 90, 120 minutes) regardless of the duration parameter value.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | Date in YYYY-MM-DD format. Omitting defaults to today (UTC). |
| `duration` | integer | No | Requested slot duration in minutes. Note: upstream returns all duration options per slot regardless of this value. |
| `sport_id` | string | No | Sport filter. |
| `tenant_id` | string | Yes | Unique tenant/club UUID (from search_tenants results) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-playtomic-com-api-53867326/get_court_availability \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","duration":"<integer>","sport_id":"<string>","tenant_id":"<string>"}'
```

### get_tenant

Get detailed information for a specific club, including resource/court list, opening hours, and booking settings. Returns stale_input with kind 'input_not_found' if the tenant_id does not exist (upstream 404).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `tenant_id` | string | Yes | Unique tenant/club UUID (from search_tenants results) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-playtomic-com-api-53867326/get_tenant \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tenant_id":"<string>"}'
```

### search_tenants

Search for sports clubs/tenants by name. Returns a paginated list of matching clubs with their addresses, resources (courts), and opening hours. Paginates via zero-based page index.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number (0-indexed) |
| `per_page` | integer | No | Results per page |
| `query` | string | Yes | Search query for club name (e.g. 'Madrid', 'City Tennis Club') |
| `sport_id` | string | No | Sport filter. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-playtomic-com-api-53867326/search_tenants \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","per_page":"<integer>","query":"<string>","sport_id":"<string>"}'
```
