OLX
OLX Categories API
The category tree of one OLX Europe site (olx.pl, olx.ro, olx.pt, olx.bg, olx.ua, olx.kz or olx.uz): id, name, parent_id, level, path, url, type (goods, automotive, real_estate, job and so on) and count (active ads), with children. Without parent_id: the top-level categories and their direct children (children_count tells which go deeper); with parent_id: that category's whole subtree. The ids feed search, seller-ads and 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/jsonparent_idintegerReturn this category's whole subtree (its children, their children and so on). Without it: the top-level categories with their direct children.
Example: 5
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.
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.kz— olx.kz, KZT, Russian by default, Kazakh with language kk.uz— olx.uz, UZS, Russian by default, Uzbek with language uz.
Request
from scavio import ScavioClient
client = ScavioClient(api_key="sk_live_your_key")
# Every car category on olx.pl with its active ad count.
def walk(nodes, depth=0):
for c in nodes:
print(" " * depth, c["id"], c["name"], c["count"])
walk(c.get("children") or [], depth + 1)
walk(client.olx.categories(parent_id=5)["data"]["categories"])Response