OLX
OLX Similar Ads API
The ads OLX recommends next to one ad (about 30), on olx.pl, olx.ro, olx.pt, olx.bg or olx.ua, in the search item shape: id, title, price, condition, every parameter, category, location, dates, promoted and delivery flags, photos and the seller id. Use it to find comparable listings for pricing a used item. 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/jsonoffer_idstring | integerAn OLX ad id: items[].id of a search, e.g. 1107557408. Send offer_id or url, not both.
Example: 1107557408
urlstringAn OLX ad link on any of the seven sites. The market follows the link; a link on one site with a different country is a 400.
Example: https://www.olx.pl/d/oferta/iphone-13-pro-128gb-graphite-pudelko-etui-szybki-ochronne-100-sprawny-CID99-ID1cXcha.html
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 statistics import median
from scavio import ScavioClient
client = ScavioClient(api_key="sk_live_your_key")
# Comparable asking prices for one ad.
res = client.olx.similar(offer_id=1107557408)["data"]
prices = [ad["price"]["value"] for ad in res["items"] if ad["price"] and ad["price"]["type"] == "price"]
print(res["count"], "similar ads, median asking price", median(prices), "PLN")Response