OLX
OLX Category Filters API
The filters one OLX category offers on olx.pl, olx.ro, olx.pt, olx.bg or olx.ua, ready to send to search and seller-ads: each with key, label, type, kind (range or choice), unit, send_as (the filters keys to use), the site's suggested range steps, and for choice filters every value with its label and the number of matching ads. Also the category's ad count, its counts per region (or per city inside region_id) and per category. Use it to discover rooms, area, year, mileage and other category filters. Costs 1 credit per request.
Authorizations
AuthorizationstringheaderrequiredBearer authentication header of the form Bearer <token>, where <token> is your Scavio API key (e.g. Bearer sk_live_your_key).
Body
application/jsoncategory_idstring | integerrequiredThe category: categories[].id of the categories endpoint or an item's category_id (14 = flats for sale on olx.pl, 84 = cars).
Example: 14
querystringCount values for this keyword inside the category, 1-200 characters.
Example: iphone
region_idintegerCount values in this region only; locations then lists the region's cities instead of regions.
Example: 2
countryenum<string>default:plThe OLX site. Titles, parameters and labels come back in the site's language (Polish on pl; Russian by default on kz and uz), prices in its currency. When you send a url, the market follows the url. This endpoint is not available on kz and uz (a 400, not charged).
Example: pl
pl— olx.pl, PLN, Polish. The default.ro— olx.ro, RON, Romanian.pt— olx.pt, EUR, Portuguese.bg— olx.bg, EUR, Bulgarian.ua— olx.ua, UAH, Ukrainian.
Request
from scavio import ScavioClient
client = ScavioClient(api_key="sk_live_your_key")
# Discover the flat filters on olx.pl, then search two-room flats over 40 m2.
f = client.olx.filters(category_id=14)["data"]
for flt in f["filters"]:
print(flt["key"], flt["kind"], flt["send_as"], [v["value"] for v in flt["values"]][:5])
res = client.olx.search(category_id=14, filters={"filter_enum_rooms": ["two"], "filter_float_m:from": 40})["data"]
print(res["total"], "flats")Response