Category tree
Lists the Avito.ma category tree with ids, names, ad types and URL slugs, in French or Arabic.
Loading / 加载中…
Avito.ma API · Classifieds & second-hand data
The Avito.ma API reaches Morocco's classifieds marketplace through four operations: a category tree with ids, a city and district list with ad counts, keyword and category search with price, seller and ad-flag filters, and a detail record for a single ad.
JSON in, a structured response out. Every public gateway endpoint uses POST.
Lists the Avito.ma category tree with ids, names, ad types and URL slugs, in French or Arabic.
Returns one ad by list_id or ad address: text, price, location, seller, phone, images and attribute rows.
Lists Moroccan cities and towns with slugs, ad counts and districts, or narrows the list to one city.
Searches ads by keyword or category and narrows them by city, district, price, seller type and ad flag.
The category tree opens with an all-categories root and four sections, Avito Market, Immobilier, Véhicules and Entreprise, with the branches and leaves below them. Each entry of categories[] carries a category_id, a name and an ad_type. It also holds search_ad_type, url_slug and a nested children[] list that continues the branch.
Ids repeat across the tree, because property leaves appear once in each of the sale, rent, flat-share and holiday-rent trees: the tree held 153 nodes but only 140 distinct ids on 2026-11-03. The ad_type of a node says which tree it sits in, and search_ad_type is the value that body.ad_type needs to reach exactly that node.
Each entry of cities[] holds a city_id, a name, a slug and an ad_count. Its areas[] list names the districts inside the city, each with an area_id, a name and a slug.
The list contained 595 cities and towns on 2026-11-03, and ad_count gives the number of ads published in each of them. Slugs drop accents, so Fès becomes fes and Béni Mellal becomes beni_mellal. Avito builds its own city picker from this block of data.
Each entry of listings[] describes one ad, and its main fields read as follows:
| Field | What it tells you |
|---|---|
price | the asking price as a number |
price_display | the price as the ad card prints it |
currency | the currency the ad publishes its price in |
old_price | the previous price of the ad |
city | the city where the ad is placed |
area | the district inside that city |
posted_at | the time the ad was posted |
images | the pictures attached to the ad |
attributes | detail rows specific to the ad's vertical |
price_matches_display shows whether the number agrees with the printed price, monthly_payment carries a monthly payment figure and image_count counts the pictures. The attributes[] entries hold a label, a value and a display form. Each also has a unit, a section and a code.
Besides listings[], a search can return projects[], a separate list of new-development project cards that are never mixed into the ad rows. A card has a kind, a title, a url, a city and an area.
Its price comes as price, price_display and currency. The rooms, bathrooms, size and image fields describe the development, and a card carries no ad id.
Avito's own markings come back as separate fields on a row, and each one shows whether the ad carries that marking:
| Field | What it tells you |
|---|---|
is_premium | whether the ad is a premium ad |
is_highlighted | whether the ad is highlighted |
is_urgent | whether the ad is marked urgent |
is_hot_deal | whether the ad is flagged as a promotion |
is_promoted | whether the ad is promoted |
offers_shipping | whether the ad offers shipping |
The seller object describes who posted the ad, with a seller_id, a name, a website and a logo. The registered_since and active_listings_count fields show when the seller registered and how many ads the seller has active. Verification status appears in is_verified and phone_verified.
body.ad_type chooses which tree a property id searches; the sale tree applies when it is left out.
For category 1010, apartments, the other values map to three trees:
rent: apartments to let, tree 1300holiday_rent: holiday lets, tree 1500shared_rent: flat-shares, tree 1400The choice is not limited to property: rent with category 2100 gives car rental, and the same input works on trucks. Each row echoes its own ad_type as SELL, LET, VAC_RENT or CO_RENT.
avito-ma-detail returns a single listing that shares many fields with a search row and adds more. Its description holds the whole ad text, category_path[] lists the categories above the ad and videos[] sits next to images[]. The seller object carries the seller profile, including a store id and a listing count.
Which attribute rows an ad carries depends on its vertical: storage and condition for a phone, year, mileage, gearbox and fuel for a car, and rooms, surface and floor for an apartment.
Avito.ma is a Moroccan online classifieds marketplace where people buy and sell cars, homes, electronics, clothing and other goods. Its store listing calls it the largest such platform in the country. Schibsted started Avito in Morocco in 2012, and in 2020 Adevinta agreed to sell it, together with Tayara in Tunisia and Fincaraíz in Colombia, to Frontier Digital Ventures.
Sellers fall into private individuals, known as particuliers, and professionals such as real estate agencies and brands. Real estate covers existing properties and new-build developments, which have their own dedicated platform started in 2019.
POST /api/v1/avito-ma/<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).avito-ma-search requires at least one of body.q or body.category.body.ad_type set to a rent type needs a body.category, and a category absent from that ad type, such as 5010 phones with rent, is rejected.body.area requires body.city; a city that Avito does not know is rejected rather than answered with country-wide results.body.price_min and body.price_max accept integers from 0 upward.projects[] are not bound by the district filter.Call avito-ma-categories and read category_id next to name in the returned tree. Phones are 5010, used cars 2010, vehicle parts 2040 and apartments 1010, while the four roots are 7100 for Market, 1000 for Immobilier, 2000 for Véhicules and 6000 for Entreprise. Send the id as body.category of avito-ma-search; apartment ids are shared by several trees, which body.ad_type separates.
Call avito-ma-locations to read each city's slug and the slug of every district in its areas[]. Pass the city slug as body.city and the district slug as body.area of avito-ma-search. Names work for the city as well, and common English and French spellings such as Fez, Marrakesh, Tangier, Casa, Tetuan, El Aaiun, Al Hoceima, Chaouen and Mazagan are mapped to the right city.
Set body.page to 1 for the first page and raise it by one for each later page, keeping the other inputs unchanged so the pages come from the same search. Rows can repeat across neighbouring pages, so key them on list_id and drop the repeats. Each page holds about 35-38 rows and no input changes the size.
Set body.seller_type to private for individuals or to professional for professional sellers and shops; without it, rows from both groups come back. In a detail record the same distinction appears as seller_type with STORE or PRIVATE, and seller_type_code shows the page's own shop or private.
Send body.list_id, the number that ends an ad address, or body.url with the ad address in its short or long friendly form, to avito-ma-detail. A search row already carries both list_id and url, so no address needs to be assembled. Give one of the two inputs per call; the result is a single listing for that ad.
Set body.lang to ar for Arabic or fr for French, which is the default; all four operations take the input. It changes the language of the category and location names Avito prints. Ad titles and bodies stay as the seller wrote them, in French or Arabic, whichever value is chosen.
Use body.ad_options: urgent keeps ads their sellers flagged as urgent, hotdeal keeps promotions known as bonne affaire, has_image keeps ads that show a photo or a video, and has_price keeps ads that publish a price. The alternative name ad_option works too. body.ad_options takes one flag per request.
Call avito-ma-detail with the ad's list_id or url. For a removed or expired ad Avito redirects the old address to a search page, and the operation detects that redirect and answers not found instead of returning a listing. A stored list_id that starts answering this way marks an ad that is gone.