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

# Spaces

Spaces for rent by the hour, newest first.

- `GET https://api.dev.repp.co.il/v1/spaces`
- Public: no key.

There is no street address: only the region and the town.

## Query parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `region` | one of: gush_dan, shfela, sharon, haifa, jerusalem, north, south, judea_samaria | — | Only this region. |
| `limit` | integer 1–100 | `60` | How many to return, 1 to 100. |
| `offset` | integer 0–5000 | `0` | How many to skip from the start (for the next page), up to 5000. |

## Request

**cURL**

```bash
curl "https://api.dev.repp.co.il/v1/spaces?region=gush_dan"
```

**JavaScript**

```js
const response = await fetch("https://api.dev.repp.co.il/v1/spaces?region=gush_dan");
if (!response.ok) throw new Error((await response.json()).error.message);
const data = await response.json();
```

**TypeScript**

```ts
/** One page of a list. */
interface SpacePage {
  items: Space[];
  more: boolean;
}

/** A space for rent by the hour. */
interface Space {
  id: string;
  name: string;
  photo_url: string | null;
  region: Region;
  city: string | null;
  price_per_hour: number;
  capacity: number;
  days: number[];
  open_from: string;
  open_to: string;
  business: Business;
}

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

/** A business, as the public index shows it. */
interface Business {
  id: string;
  name: string;
  photo_url: string | null;
}

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

const response = await fetch("https://api.dev.repp.co.il/v1/spaces?region=gush_dan");
if (!response.ok) throw new Error(((await response.json()) as ApiError).error.message);
const data = (await response.json()) as SpacePage;
```

**Python**

```python
import requests

response = requests.get(
    "https://api.dev.repp.co.il/v1/spaces?region=gush_dan",
    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/spaces?region=gush_dan");
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
{
  "items": [
    {
      "id": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e",
      "name": "מתחם הקומה השנייה",
      "photo_url": null,
      "region": "gush_dan",
      "city": "רמת גן",
      "price_per_hour": 90,
      "capacity": 12,
      "days": [
        0,
        1,
        2,
        3,
        4
      ],
      "open_from": "11:00",
      "open_to": "16:00",
      "business": {
        "id": "7c1f6a52-3b8e-4d1a-9f0e-2a6b8c4d5e10",
        "name": "סטודיו נועה",
        "photo_url": null
      }
    }
  ],
  "more": false
}
```

## Response fields

| Field | Type | Description |
| --- | --- | --- |
| `items` | array of Space | The items of this page. |
| `items[].id` | string | Identifier. |
| `items[].name` | string | The space's name. |
| `items[].photo_url` | string, nullable | The space's photo, or null. |
| `items[].region` | one of: gush_dan, shfela, sharon, haifa, jerusalem, north, south, judea_samaria | A region of Israel: one of the keys in Catalog. |
| `items[].city` | string, nullable | The town, from our list of towns, or null. |
| `items[].price_per_hour` | integer | Rent for one hour, in whole shekels. |
| `items[].capacity` | integer | How many people fit in it. |
| `items[].days` | array of integer | The weekdays it can be rented, 0 = Sunday. |
| `items[].open_from` | string | Opening time. |
| `items[].open_to` | string | Closing time. |
| `items[].business` | Business | A business, as the public index shows it. |
| `items[].business.id` | string | Identifier. |
| `items[].business.name` | string | The business's name. |
| `items[].business.photo_url` | string, nullable | The business's photo, or null. |
| `more` | boolean | There is another page: ask again with a larger offset. |

## Errors

| Status | Code | Meaning |
| --- | --- | --- |
| 400 | `bad_parameter` | A parameter is not one the endpoint accepts. The message names it. |
| 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. |
