Listing detail
Reads one 2dehands or 2ememain ad in full, given an item id from search or the public address of the ad.
Loading / 加载中…
2dehands API: Belgian classifieds search and listings · Classifieds & second-hand data
The 2dehands API reads Belgian second-hand classifieds from 2dehands, the Dutch-language site, and 2ememain, its French-language counterpart. Search a keyword to get paged result rows, then open a single ad by its item id or its public address to read what the seller published about it.
JSON in, a structured response out. Every public gateway endpoint uses POST.
Reads one 2dehands or 2ememain ad in full, given an item id from search or the public address of the ad.
Searches Belgian 2dehands or 2ememain classifieds by keyword and returns up to 30 ad rows per page, over two pages.
2dehands and 2ememain are essentially one Belgian classifieds site in two languages, and both names mean second hand. The ads on it cover new and used goods as well as services and are organised into sections. They range from vehicles and car parts to real estate, collectibles and hobby items, next to everyday second-hand goods and items that are given away for free.
A call to post-2dehands-search returns rows that each describe one classified ad. A row carries an item_id, the ad's title, its price in euros and a price_type holding the platform's own label for how the ad is priced.
Rows also name the seller and the location of the item and include its images, which is enough to build a result list with thumbnails without a second call. Besides the rows, data holds total and paging details that describe the two-page window of the search.
post-2dehands-listing returns one ad in full. The record confirms which listing it describes and carries the complete text the seller published, where a search row only offers the title. It adds the photo gallery, names the category the ad is filed under, and describes the seller through their public profile together with the location of the item.
Posting statistics for the ad come with it as well. Prices again appear in euros next to the price type. A GTIN is included when the ad has one and is null otherwise, so code that links second-hand offers to a product catalogue needs a fallback, such as matching on title and category, for ads without it.
body.site decides which language version a call reads. A search reads one version at a time, so write the keyword in the language of the version you search, and run the search once per site when both language communities matter to your project. For a bicycle, for example, one call sends "fiets" in body.query with be_nl and a second sends "vélo" with be_fr; each call returns its own rows with their item_id values, together with its own total and paging details.
body.query must be sent with every search. Choose the page either with body.offset, where 0 starts the first page and 30 the second, or with body.page set to 1 or 2. One of them is enough, and without either the first page is read.
If both are sent they must point to the same page: offset 30 together with page 2 is accepted, while offset 0 together with page 2 is rejected. body.max_results trims how many rows of the chosen page come back, from 1 up to 30, without moving the page boundaries: a short list requested at offset 30 holds the opening rows of the second page, never rows from further down the first page. Leaving it out returns every row of the chosen page.
{
"body": {
"query": "iphone",
"site": "be_nl",
"page": 1,
"max_results": 10
}
}POST /api/v1/tweedehands/<action> with x-api-key, Content-Type: application/json and a required Idempotency-Key.ok: true: data is the result of the operation, meta.requestId identifies the recorded request and meta.chargedCreditUnits is the amount charged. Otherwise ok is false and error.code names the reason; read ok and error.code rather than relying on the HTTP status alone. Every gateway reply carries a request id for support: meta.requestId, or a top-level requestId in a reply without meta (such as a refusal before admission).Run a keyword search first. Each search row includes an item_id such as m2448719601, and that string can be sent unchanged in item_id on the listing call. If you already have the address of the ad, for example from a link a user pasted, send it in url instead; both the canonical Belgian address containing /v/ and the relative path alone are accepted. Send one of the two fields.
A search page holds up to 30 rows and a query can be read on two pages, so one keyword reaches no more rows than those two pages hold. For more distinct ads, run narrower or different keywords, because a third page is not accepted.
Set site to be_fr. Without it, both operations read 2dehands, the Dutch-language version, because be_nl is the default. The value applies to one call at a time, so a French search followed by a listing lookup sends be_fr on both requests.
No. The query field is a keyword search over ads and is not a lookup by seller or by GTIN. To find ads for a particular product, search its name or model as keywords and then open the matching rows with the listing call.
No. The search takes a keyword in query, the language version in site, the page through offset or page, and a row limit in max_results; none of these inputs filters by category or by price. Each search row carries the ad's euro price and its price_type, while the category of an ad is returned only by the listing call.
Repeat the same search at the interval you choose, keeping query and site unchanged, and store the item_id of each row you receive. A row whose item_id is not yet in your store is an ad that earlier runs did not return. Read both pages on each run without max_results, so that no row of either page is left out of the comparison.