OLX
OLX Locations API
Place autocomplete for OLX location filters on any of the seven OLX Europe sites: the cities and districts matching a name, each with city_id, district_id and region_id to send to search and seller-ads (city_id with distance_km for a radius), plus the municipality, county and region names. 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/jsonquerystringrequiredAt least 2 letters of a city or district name, up to 100 characters, in the site's language.
Example: Warszawa
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")
# Resolve a city, then search within 30 km of it.
loc = client.olx.locations(query="Warszawa")["data"]["locations"][0]
res = client.olx.search(query="rower", city_id=loc["city_id"], distance_km=30)["data"]
print(loc["city"], loc["region"], res["total"])Response