> Documentation index: https://docs.dev.repp.co.il/llms.txt - fetch it to find every page of these docs.

# One trainer

One trainer from the public index. `404` when the trainer is not (or no longer) in it.

- `GET https://api.dev.repp.co.il/v1/trainers/{id}`
- Public: no key.

## Path parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `id` **(required)** | uuid | — | The trainer's id. |

## Request

**cURL**

```bash
curl "https://api.dev.repp.co.il/v1/trainers/3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b"
```

**JavaScript**

```js
const response = await fetch("https://api.dev.repp.co.il/v1/trainers/3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b");
if (!response.ok) throw new Error((await response.json()).error.message);
const data = await response.json();
```

**TypeScript**

```ts
/** A trainer in the public index. Never a phone number or the trainer's free-text about. */
interface Trainer {
  id: string;
  name: string;
  photo_url: string | null;
  styles: Style[];
  regions: Region[];
  rating: Rating;
  verified: boolean;
  available_now: boolean;
}

/** A training style: one of the keys in Catalog. */
type Style =
  | "pilates"
  | "barre"
  | "strength"
  | "crossfit"
  | "trx"
  | "calisthenics"
  | "cardio"
  | "hiit"
  | "spinning"
  | "running"
  | "aqua"
  | "yoga"
  | "mobility"
  | "meditation"
  | "personal"
  | "martial_arts"
  | "boxing"
  | "krav_maga"
  | "dance"
  | "zumba"
  | "kids"
  | "seniors"
  | "other";

/** A region of Israel: one of the keys in Catalog. */
type Region = "gush_dan" | "shfela" | "sharon" | "haifa" | "jerusalem" | "north" | "south" | "judea_samaria";

/** The rating, or null while nobody has rated yet. */
type Rating = {
  average: number;
  count: number;
} | null;

interface ApiError {
  error: { code: string; message: string; reason?: string };
}

const response = await fetch("https://api.dev.repp.co.il/v1/trainers/3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b");
if (!response.ok) throw new Error(((await response.json()) as ApiError).error.message);
const data = (await response.json()) as Trainer;
```

**Python**

```python
import requests

response = requests.get(
    "https://api.dev.repp.co.il/v1/trainers/3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b",
    timeout=30,
)
if not response.ok:
    raise RuntimeError(response.json()["error"]["message"])
data = response.json()
```

**PHP**

```php
<?php
$ch = curl_init("https://api.dev.repp.co.il/v1/trainers/3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($ch), true);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 400) {
    throw new RuntimeException($data["error"]["message"]);
}
```

## Response (200)

```json
{
  "id": "3f2b9c1e-8a7d-4e6f-b5a4-1c2d3e4f5a6b",
  "name": "דנה כהן",
  "photo_url": "https://example.supabase.co/storage/v1/object/public/avatars/3f2b9c1e/photo.webp",
  "styles": [
    "yoga",
    "pilates"
  ],
  "regions": [
    "gush_dan"
  ],
  "rating": {
    "average": 4.8,
    "count": 12
  },
  "verified": true,
  "available_now": true
}
```

## Response fields

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | Identifier. |
| `name` | string | The trainer's name. |
| `photo_url` | string, nullable | The trainer's photo, or null. |
| `styles` | array of Style | The styles the trainer teaches. |
| `regions` | array of Region | The regions the trainer works in. |
| `rating` | Rating, nullable | The rating, or null while nobody has rated yet. |
| `rating.average` | number | The average stars, 1 to 5, to two decimals. |
| `rating.count` | integer | How many ratings. |
| `verified` | boolean | We checked the trainer's instructor certificate (the blue check). |
| `available_now` | boolean | The trainer's "looking for work" switch is on. |

## Errors

| Status | Code | Meaning |
| --- | --- | --- |
| 404 | `not_found` | No such endpoint, or no such item for this caller. |
| 429 | `too_many_requests` | Over the rate limit. Wait the seconds in `Retry-After` (60) and go on. |
| 500 | `server_error` | Something failed on our side. Try again shortly. |
