Category tree
List the rubriky of a market with their ad counts, or the subcategories of one rubrika.
Loading / 加载中…
Bazos API · Classifieds & second-hand data
The Bazos API has 3 operations for the Czech and Slovak classifieds: a category tree per market, a paged ad search and a single-ad read. The `slug` values of the category tree feed the search, and the `url` of a search row leads to the ad detail.
JSON in, a structured response out. Every public gateway endpoint uses POST.
List the rubriky of a market with their ad counts, or the subcategories of one rubrika.
Read one ad with its price, location, photos, view count, posting date and seller name.
Search ads by keyword, category, postal-code radius and price band, with 5 sort orders.
bazos-categories answers in one of two shapes, depending on body.category. Without it, data holds market and categories, one row for each of the market's 20 rubriky (top-level categories). With a rubrika slug, data holds market, category and subcategories, the children of that rubrika.
Each categories row has a slug, a label and a url, plus total_listings and listings_last_24h. The last two show how many ads the rubrika holds and how many were added in the last 24 hours. Each subcategories row has a slug, a label and a url.
bazos-search puts the matching ads in listings, and each row is a compact ad:
| Field | What it tells you |
|---|---|
listing_id | the numeric id of the ad |
url | the link to the ad |
title | the headline of the ad |
description_excerpt | a short excerpt of the ad text |
image | the picture shown with the row |
price | the asking price |
price_currency | the currency of that price |
price_kind | the pricing case: fixed, free, negotiable, in_text or absent |
price_text | the price as the ad prints it |
locality and postal_code | where the ad is located |
views | how many times the ad was viewed |
posted_date | the date the ad was posted |
promoted and promoted_label | whether the row is a paid placement, and its label |
category | the rubrika the ad belongs to |
Beside listings, data returns market and currency. It also repeats query, category and subcategory as the call used them.
body.query is matched against ad titles and bodies, and keyword and q are accepted as alternative names for it. body.category takes a rubrika slug, and body.subcategory takes a slug from inside that rubrika, such as apple under mobil or Audi under auto.
body.postal_code centres the search on a place, and body.radius_km sets the distance around it in kilometres. body.price_min gives the lowest price to include and body.price_max the highest, and either one can be sent without the other. Both are read in the currency of body.market.
body.sort takes one of 5 orders, and newest is the default:
newest: the latest ads first, with paid TOP ads on topprice_asc: the cheapest ads firstprice_desc: the most expensive ads firstmost_viewed: the most viewed ads firstleast_viewed: the least viewed ads firstUnder the two price orders Bazos drops ads whose price is a word such as "Dohodou", "Nabidnete" or "V textu", so total_results shrinks. total_results is the match total and comes with the total as Bazos prints it, while page, page_size and has_more show the position in the paging, 20 ads to a page.
The record of bazos-listing repeats the price, place, view and promotion fields of a bazos-search row and adds fields that a row does not carry. description takes the place of the description_excerpt of a row, breadcrumb shows the category trail above the ad, and images lists the photos where a row has one image, with image_count showing how many photos there are.
seller.display_name shows the name under which the seller posted the ad.
body.market selects one of two separate marketplaces: cz reads bazos.cz with prices in CZK, and sk reads bazos.sk with prices in EUR. Each has its own listings, its own category slugs and its own currency, and cz is the default.
The slug differs between the two sides for 7 rubriky:
| Czech slug | Slovak slug | What it covers |
|---|---|---|
dum | dom | the home and garden rubrika |
motorky | motocykle | the motorcycles rubrika |
nabytek | nabytok | the furniture rubrika |
obleceni | oblecenie | the clothing rubrika |
prace | praca | the work rubrika |
zvirata | zvierata | the animals rubrika |
ostatni | ostatne | the other rubrika |
The remaining rubriky keep one slug in both markets, so call bazos-categories with the market you query to read its slugs.
Bazos is a free online classifieds site where people post ads for used and other goods such as computers, phones, cars, pets and children's items. It runs as national sites, among them bazos.cz for Czechia and bazos.sk for Slovakia, and each has its own homepage and its own categories, called rubriky.
Buyers narrow ads by category, by distance around a chosen location and by a price range, besides searching by item name. A TOP ad is a paid placement that lifts a listing higher in category results, while most ads are posted free.
POST /api/v1/bazos/<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).total_listings for both markets.body.postal_code in a list of places.body.page runs from 1 to 500, so a search reaches at most page 500 of its results.body.radius_km runs from 0 to 500 and is ignored when body.postal_code is not sent.body.postal_code that Bazos does not recognise instead of ignoring it.body.price_min and body.price_max are whole numbers that start at 0.body.subcategory works only together with body.category.body.listing_id needs body.category next to it, and body.category is ignored when body.url is sent.body.market value and does not substitute cz.bazos-listing does not fetch the click-to-reveal phone, and description comes back as the seller wrote it, contacts typed into it included.Call bazos-categories with the market you search and without body.category, and take the slug of a row as body.category. Call it again with that slug to list the subcategories, and use a subcategory slug as body.subcategory in bazos-search. Read the slugs for the market you query, because the Czech and Slovak catalogues spell several of them differently, and keep the same body.market across these calls.
Send the 5-digit code as body.postal_code and a distance in kilometres as body.radius_km; without a radius the search uses 25. Czech codes go with cz and Slovak codes with sk in body.market. Add body.query or body.category to keep the rows relevant, and read total_results to see how many ads fall inside the radius.
Send the url of the row as body.url to bazos-listing, since the address already carries the category and the market. When you hold only the numeric id, send it as body.listing_id together with the rubrika slug as body.category. The call returns the record of that single ad, with its description, photos and seller name.
Repeat the call with the same inputs and raise body.page by 1. The page field of data confirms which page you received, and has_more shows whether a further page follows, so you can stop when it says there is none. Keep body.sort unchanged between calls, because a different order rearranges the rows and moves ads from one page to another.
Read promoted in each row of the listings that bazos-search returns; it marks a paid TOP ad, and promoted_label carries the label that goes with it. A TOP ad keeps the position where Bazos shows it, even when it is off topic for your keyword, so skip the rows that promoted marks when you want only the other matches. The same two fields appear in the record that bazos-listing returns.
A negotiable or unpriced ad returns a null price rather than a fake zero. In bazos-search rows, price_kind then names the case, for example negotiable. Check that price_kind is fixed before you average prices, and keep the other rows in a separate group, because an unpriced ad has no figure to average.
Yes. body.query is optional when body.category is sent, so a call with only a market and a category browses that rubrika page by page. Add body.subcategory to go one level down and body.sort to change the order. Take the rubrika slug from bazos-categories for the market you browse.