The API returns all currently available listings on apartment24.ch as JSON: address, rent, availability, photos, description, amenities, parking, rental terms, contact details and direct links.
| Endpoint | https://apartment24.ch/api/listings.php |
|---|---|
| Method | GET (also HEAD, and OPTIONS for CORS) |
| Response | JSON, UTF-8 |
| Access | no login, no API key |
| CORS | allowed from any origin (Access-Control-Allow-Origin: *) |
| Source ID | quelle = your own ID (request it at b2b@apartment24.ch), otherwise 0 |
Source ID (quelle): the source ID tells us who sent a request. It is added to every link in the response, so applications made through these links can be attributed to you. You can request your own source ID from us at b2b@apartment24.ch. Otherwise, always use quelle=0. Use url and application_url exactly as returned; do not build your own links to our pages.
There are three calls. All parameters are optional and can be combined. The examples use quelle=999 as a sample; use your own source ID, or 0 if you do not have one.
| Call | Result |
|---|---|
/api/listings.php?quelle=999 | list of available listings (field listings) |
/api/listings.php?id=2520&quelle=999 | one listing (field listing); 404 if no longer available |
/api/listings.php?locations=1 | cantons and cities with the number of available listings (field cantons) |
| Parameter | Values | Meaning |
|---|---|---|
quelle | 0–999 | your own source ID, added to all links; otherwise 0 (default) |
lang | de (default), en, fr, all | language of texts and links; all = all three in one response |
location | text, 1–60 characters | city, district, canton (name or code, e.g. ZH) or 4-digit postcode |
types | room, apartment, parking, storage, restaurant, store, comma-separated | listing type |
max_rent_chf | number | maximum monthly rent in CHF |
available_by | YYYY-MM-DD | available on or before this date |
min_rooms | number | minimum number of rooms (apartments) |
min_size_m2 | number | minimum size in m² |
balcony | 1 or 0 | only listings with a balcony |
details | 1 (default) or 0 | 0 = basic fields only, no photos, description or terms |
limit | 1–200, default 200 | listings per page |
offset | from 0 | first listing of the page |
Paging: the response contains total, count, offset and has_more. While has_more is true, request again with offset + count.
Each parameter may appear only once. Unknown parameters are rejected with status 400.
Every response starts with generated_at, source (the source ID used) and lang, followed by the data for the call. Fields without a value are null.
{
"generated_at": "2026-12-04T10:15:00+01:00",
"source": 999,
"lang": "en",
"total": 143, "count": 2, "offset": 0, "has_more": true,
"listings": [
{
"id": 2520,
"type": "room",
"title": "Furnished Room",
"street": "Musterstrasse 12", "zip": "4710", "city": "Balsthal", "canton": "SO",
"rent_chf": 790,
"available_now": true, "available_from": "2026-12-04",
"url": "https://apartment24.ch/en/room/.../2520?quelle=999",
"application_url": "https://apartment24.ch/en/tenant/application-form?inserat=2520&quelle=999",
"images": ["https://apartment24.ch/graphics/uploads/room_2520_1.webp"],
"description": "...",
"features": { "furnished": true, "wifi_included": true, "bathroom": "shared" },
"conditions": { "min_rental_months": 1, "deposit_months": 1 },
"parking": { "private_parking_on_request": false, "parking_spaces_same_zip": [] },
"contact": { "phone": "0800 24 77 24", "whatsapp_url": "https://wa.me/..." }
}
]
}
The example is shortened. Each listing contains these fields:
| Field | Content |
|---|---|
id | listing number |
type | room, apartment, parking, storage, restaurant, store |
title | listing type as text in the chosen language |
street, zip, city, canton, district | full address; canton as a two-letter code |
lat, lng | coordinates, if available |
rent_chf, rent_on_request | monthly rent in CHF; if rent_on_request is true, rent_chf is null |
available_now, available_from | available now / available from (YYYY-MM-DD) |
size_m2, rooms, floor | size, number of rooms, floor |
url | link to the listing page, including your source ID |
application_url | link straight to the application form, including your source ID |
image_url, images | main image and all photos |
example_photos | true = sample photos, not photos of this listing |
description | description text, as on the listing page |
features | amenities: furnished, Wi-Fi, cleaning, kitchen, bathroom, fridge, balcony, terrace, washing machine, official registration possible |
max_rental_until | end date if the rental is fixed-term, else null |
conditions | minimum stay (1 month), notice period (14/30 days), deposit (1 month's rent, cash possible), payment in advance, what is included, plus texts on payment, minimum stay and notice |
parking | private parking on request, public parking nearby, our available parking spaces with the same postcode |
contact | phone, email, WhatsApp number and whatsapp_url with a prefilled message |
With details=0 only the basic fields are returned: id to lng, plus url and image_url.
All languages with lang=all: the fields title, description, url, application_url, conditions.payment_terms, conditions.min_rental_text, conditions.notice_period_text, contact.whatsapp_url and the url of parking spaces then look like this:
"title": { "de": "Möbliertes Zimmer", "en": "Furnished Room", "fr": "Chambre meublée" }
All other fields are the same in every language and stay plain values.
On error, the API returns an HTTP status other than 200 and this JSON (messages are in German):
{ "error": { "code": "bad_request", "message": "lang muss de, en, fr oder all sein." } }
| Status | code | When |
|---|---|---|
| 400 | bad_request | invalid or unknown parameter |
| 404 | not_found | no listing with this id, or it is no longer available |
| 405 | method_not_allowed | method other than GET |
| 429 | rate_limited | more than 120 requests per minute per IP; header Retry-After: 60 |
| 500 | internal_error | error on our side |
| 503 | unavailable | data temporarily unavailable; retry later |
Cache-Control: public, max-age=300). New or rented listings show up within 5 minutes.Examples:
https://apartment24.ch/api/listings.php?quelle=999
https://apartment24.ch/api/listings.php?quelle=999&lang=all
https://apartment24.ch/api/listings.php?quelle=999&lang=en&location=Winterthur&types=room&max_rent_chf=1000
https://apartment24.ch/api/listings.php?quelle=999&location=8400&available_by=2027-01-31
https://apartment24.ch/api/listings.php?quelle=999&id=2520&lang=en
https://apartment24.ch/api/listings.php?locations=1
Quick test from the command line:
curl -s "https://apartment24.ch/api/listings.php?quelle=999&lang=en&location=Winterthur&limit=2"