Documentation
2dehands API reference
Reference for the 2dehands API: keyword search over Belgian classifieds in two pages of up to 30 rows, and full listing lookup by item id or public URL.
See also: 2dehands API: Belgian classifieds search and listings overview and prices · 2dehands API guide: search, paging and listing lookups
On this page
2dehands API keyword search over 2dehands and 2ememain
post-2dehands-search treats body.query as keywords to match against classified ads. It is not a lookup by seller or by GTIN, so the operation offers no way to list the ads of one seller or to resolve a barcode to an ad. The short form q is also accepted in place of query.
body.site decides whether the Dutch-language 2dehands or the French-language 2ememain is searched. Each row in data describes one ad with its item_id, title, euro price, price_type (the label the platform gives to the way the ad is priced), seller, location and images.
The item_id is resolvable: it is exactly the value the listing operation expects. Besides the rows, data carries total and paging details that reflect the two-page limit of a query.
Fields in this section (3)
post-2dehands-search, body.query, body.site
Selecting the search page and trimming rows
body.offset and body.page are two ways to express the same choice: offset 0 or page 1 reads the first page, offset 30 or page 2 the second. Sending one of them is enough. When both arrive they have to name the same page; a pair that names different pages, such as offset 0 with page 2, is rejected.
Without either, the first page is read. body.max_results only shortens the list taken from the chosen page; it never shifts where a page starts, so rows that a trimmed request leaves out are not reachable through the second page. Without it, the page comes back untrimmed.
Fields in this section (4)
post-2dehands-search, body.offset, body.page, body.max_results
Reading one listing by item id or URL
post-2dehands-listing identifies the ad through one of two inputs. body.item_id takes the item_id string from a search row, such as m2448719601. body.url takes the canonical public address of the ad on the Belgian site, the form that contains /v/, or just its relative path, which helps when links were stored without the domain.
Send one of the two. The alternative names id and vip_url are also accepted in place of body.item_id and body.url. body.site selects the Dutch or the French version, as in search.
The record in data holds the confirmed identity of the listing, the full description as published, the price in euros with its price type, the photo gallery, the category, the public seller profile, the location and posting statistics. The GTIN is optional and comes back null when the ad has none.
Fields in this section (4)
post-2dehands-listing, body.item_id, body.url, body.site
{
"body": {
"query": "fiets",
"site": "be_nl",
"offset": 30,
"max_results": 10
}
}Operations
Every public gateway operation uses POST /api/v1/{project}/{action}.
Use a JSON object with the documented path, query, headers and body locations; omit unused locations. input.headers is JSON data for the operation, not browser request headers. Do not put credentials here. Keep body arrays, scalar values and null as documented; omission is different from null.
Listing detail
POST /api/v1/tweedehands/post-2dehands-listing
Reads one 2dehands or 2ememain ad in full, given an item id from search or the public address of the ad.
Input fields
| Field | Type | Required | Default | Allowed values | Limits |
|---|---|---|---|---|---|
body.item_id | string | Optional | — | — | — |
body.site | string | Optional | "be_nl" | "be_nl""be_fr" | — |
body.url | string | Optional | — | — | — |
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/tweedehands/post-2dehands-listing' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"item_id":"m2448719601"}}'Keyword search
POST /api/v1/tweedehands/post-2dehands-search
Searches Belgian 2dehands or 2ememain classifieds by keyword and returns up to 30 ad rows per page, over two pages.
Input fields
| Field | Type | Required | Default | Allowed values | Limits |
|---|---|---|---|---|---|
body.query | string | Required | — | — | — |
body.max_results | integer | Optional | — | — | 1–30 |
body.offset | number | Optional | 0 | 030 | — |
body.page | integer | Optional | — | — | 1–2 |
body.site | string | Optional | "be_nl" | "be_nl""be_fr" | — |
Request examples
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/tweedehands/post-2dehands-search' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"query":"iphone","site":"be_nl"}}'How calls work
POST /api/v1/tweedehands/<action>withx-api-key,Content-Type: application/jsonand a requiredIdempotency-Key.- A successful call returns
ok: true:datais the result of the operation,meta.requestIdidentifies the recorded request andmeta.chargedCreditUnitsis the amount charged. Otherwiseokisfalseanderror.codenames the reason; readokanderror.coderather than relying on the HTTP status alone. Every gateway reply carries a request id for support:meta.requestId, or a top-levelrequestIdin a reply withoutmeta(such as a refusal before admission). - Charged the listed price only when a call succeeds. Failures are not charged; an unconfirmed outcome is released after at most 900 seconds without a charge.
- Repeating the same request with the same Idempotency-Key after it has finished returns the stored response for 24 hours without a new charge.
In the gateway reference: