From a 2dehands API search to one full listing
A practical session starts with post-2dehands-search and a keyword such as iphone. The rows that come back are compact: title, euro price, price type, seller, location and images are there, but the full description, the category, the posting statistics and any GTIN are only in the listing record.
Pick the rows worth a closer look and pass the item_id of each one unchanged to post-2dehands-listing in body.item_id; no conversion is needed. Opening a row takes one listing call per ad, so filter on what the row already shows, such as price, price type and location, before deciding which ads to open.
Reading the second results page without gaps
Each query has two readable pages. To continue after the first page, repeat the same query and site with body.page set to 2 or body.offset set to 30; sending both is fine only when they name the same page. Trimming interacts with this in a way that is easy to miss: body.max_results shortens a page but does not change where the next page begins.
A trimmed first page returns only its opening rows, while the second page still starts at offset 30, so the remaining rows of the first page are skipped unless that page is read without body.max_results. When the goal is to collect each row the two pages offer, leave body.max_results out on both calls. Use it when only the top rows of a page matter, for example a preview of the first 5 matches.
Searching the Dutch and French versions
body.site switches between the two language versions: be_nl reads 2dehands, the Dutch-language version, and be_fr reads 2ememain, the French-language one. When the field is left out, calls read the Dutch-language version.
For an overview of both language communities, run each keyword once per site and in that site's language, for example kinderwagen on be_nl and poussette on be_fr for prams. Record the site value alongside each item_id you store and send the same value when you later open the ad with the listing call, so that the record is read from the same language version as the search row it came from.
Field names, links and empty values
The names id, vip_url and q are also accepted in place of body.item_id, body.url and body.query. When ads reach your system as links, body.url accepts the canonical Belgian address with /v/ in it and also the relative path alone, so there is no need to extract the id first.
In the listing record the GTIN is null for ads without one: treat a missing GTIN as a normal case and match ads to products by title and category instead. Finally, body.query is meant for keywords, and a seller name or a barcode number sent there does not turn the search into a seller or GTIN lookup.
Comparing prices across search rows
Every price in search rows and listing records is given in euros, so amounts from 2dehands and 2ememain can be put side by side without currency conversion. Group rows on price_type first and compare amounts only between rows that share the same price type. Because a query ends after its second page, a broad keyword can match more ads than it returns; adding a brand, a model or a size to body.query brings the ads you care about into the readable window.
How 2dehands works
On the Dutch-language site a classified ad is called a zoekertje, the Belgian Dutch word for a small ad, and sellers post one through the Plaats zoekertje button. Ads show whether the item is to be collected, marked Ophalen, or can be sent, marked Verzenden. A buyer and a seller can also settle a sale through a payment request and then send the item as a parcel.
[
{
"body": {
"query": "iphone",
"site": "be_nl"
}
},
{
"body": {
"item_id": "m2448719601",
"site": "be_nl"
}
}
][
{
"body": {
"query": "fiets",
"site": "be_nl"
}
},
{
"body": {
"query": "fiets",
"site": "be_nl",
"page": 2
}
}
]{
"body": {
"query": "vélo",
"site": "be_fr",
"max_results": 5
}
}Server-side request template
This server-side template shows authentication and request identity using the first operation of this API. Choose the operation for your use case and check its current availability and price on the API page. After a timeout, resend the unchanged request with the same Idempotency-Key.
The gateway request is always POST.
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.
# 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"}}'Integration checklist
- The API key is stored in a server-side secret manager and never sent to a browser.
- Each request carries its own Idempotency-Key, kept until the request has a final answer.
- The integration reads ok and error.code and handles each error code as the error table describes.
- An uncertain POST is inspected using its original identity, never blindly repeated with a new one.
- The operation’s current availability and price have been checked on its API page.
2dehands API: Belgian classifieds search and listings overview and prices · Read the API reference · Try it in the playground