Search 2dehands ads
2dehands (2dehands.be) classified ads for a keyword with category, postcode and distance, price, attribute filters (condition, delivery, brand...), offered-since and sort. Each result has price, attributes, photos, location and distance, date, traits and, for business sellers, the seller. facets lists attribute values with ids for attribute_ids, categories the category ids. Private sellers' names, phone numbers and email addresses are never returned (masked in ad text).
Every response includes credits_used: the credits this call cost.
Parameters
| name | type | description |
|---|---|---|
q | string | Keywords. Example: fiets |
category | string | Top-level category id (445 Fietsen en Brommers, 91 Auto's, 31 Audio Tv en Foto); see categories. |
subcategory | string | Subcategory id (from facets). |
postcode | string | Postcode to search around. |
distance_km | string | Radius in km around the postcode. |
price_min | string | Minimum price (EUR). |
price_max | string | Maximum price (EUR). |
attribute_ids | string | Attribute value ids from facets, comma-separated (e.g. 30 = new, 31 = as good as new, 32 = used). |
offered_since | today | yesterday | week | all | Only ads placed since. |
title_and_description | string | false: match keywords in titles only. |
sort | relevance | newest | oldest | price_asc | price_desc | Sort order. |
limit | integer | Results per page (max 100, default 30). |
page | integer | Results page, 1 for the first. Pass back next_page; null on the last page. |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/2dehands/v1/search?q=fiets" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/2dehands/v1/search",
params={"q": "fiets"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/2dehands/v1/search");
url.searchParams.set("q", "fiets");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).