Category tree
Returns the category tree for Agriaffaires or MachineryZone with the ids every other operation uses.
Loading / 加载中…
Agriaffaires API: machinery search, listings and dealers · E-commerce & marketplace data
The Agriaffaires API reads the two marketplaces run by MB Diffusion: Agriaffaires, for agricultural machinery such as tractors and harvesters, and MachineryZone, for construction, earthmoving and handling machinery, across 43 national hosts that each share one catalogue per site. It searches and filters listings by category, manufacturer, model, year, hour meter, engine power, price and location, reads one listing in full with every technical property the seller typed, reads one dealer's profile and stock or searches the dealer directory, publishes the category tree and filter counts, resolves locations down to the department, answers autocomplete suggestions, and looks up the price observatory's minimum, maximum and average asking price for a make, model and year.
JSON in, a structured response out. Every public gateway endpoint uses POST.
Returns the category tree for Agriaffaires or MachineryZone with the ids every other operation uses.
Reads one dealer's public business profile, stock breakdown and branch addresses by dealer id.
Pages through one dealer's own stock of listings, in the same row shape as search.
Searches the dealer directory by company name or country and orders it by name or stock size.
Returns one listing in full, with every technical property, the price and the dealer behind it.
Returns the filter values and counts available for a given query, category or country.
Returns the countries, regions and departments that the location filters accept.
Benchmarks what a make, model and construction year is actually asking, through the marketplace's own price observatory.
Searches and filters listings across Agriaffaires or MachineryZone by machine, price and location.
Turns a partly typed word into matching search phrases and categories with their counts.
Agriaffaires is one of the largest online marketplaces for used and new agricultural machinery, with classifieds for farm tractors and harvesting equipment. Its sibling marketplace, MachineryZone, operates across many countries for buying and selling used and new construction, handling, transport and forestry machinery, including auctions and rentals.
Both marketplaces are run by MB Diffusion, a French company that became a subsidiary of the classifieds group Leboncoin, then owned by Sweden's Schibsted, after an acquisition reported in November 2016. Buyers and sellers of used heavy equipment judge resale value from a machine's age, operating hours, condition, brand and market demand as it depreciates over time.
An operation's body.site defaults to agriaffaires when left out; setting it instead reads the other catalogue. body.market is a different kind of choice: it only picks the language of the labels and descriptions, never a different catalogue or a currency. The same listing answers with the same price in the same currency on every host, and the same category id returns close counts across hosts within the same minutes.
body.market defaults to fr, and country_site and locale are accepted in its place. A market and site pair with no matching host is rejected rather than answered with fields this API cannot name.
Each row of agriaffaires-search describes one advert, and body.listing_type tells you which kind applies — it defaults to everything, which mixes offers with wanted adverts and auctions, so pass sale for machines actually on offer:
sale: a machine on offer, with an asking pricewanted: a buyer's request rather than an offerauction: a lot whose auction_start_price is its opening bid, never an asking pricerental: a machine for hire, whose rental_price is a hire rate rather than a priceprice_is names which of these figures applies to a given row, and a row whose own link does not reveal the type comes back as unknown with its figure in other_type_price instead of being guessed. promoted is true for sponsored placements among the rows on a category page. Each row's specs carry a raw number together with the real unit and the unit label the page printed, because the two disagree on markets that print imperial units.
A row's listing_id becomes a full record through agriaffaires-detail. Beyond the fields a search row already carries, it adds these:
condition and availabilitydescriptionimages and the category breadcrumbprice_witness, which cross-checks the price against the figure the listing page's own structured data prints, with agreed showing whether the two matchspecs, every row of the seller's own spec table, each with its printed label, its printed value and, for a measurement, the real unit alongside the printed unit labelseller, naming the business or private party behind the advert, whose contacts give each contact's name, languages, phone number and display formAn auction's price is auction_start_price, its opening bid rather than an asking figure.
Three operations work with dealers from different angles. agriaffaires-dealer reads one profile.
agriaffaires-dealers searches the directory itself, filtered by body.company, the dealer's name, and body.country, an ISO-3166-1 code for the seller's country; name and location_country are accepted as alternative names for these two inputs. agriaffaires-dealer-listings pages through one dealer's own stock, in the same row shape agriaffaires-search returns, so a dealer's adverts carry the same fields a general search would give.
agriaffaires-categories names and counts the category tree; a leaf the facet list does not carry for the current inventory comes back with a null category_id rather than a guessed one. agriaffaires-facets answers which categories and manufacturers have stock for a query, the four advert-type values, the countries the location filters accept, and the real minimum and maximum of every numeric property for that category.
agriaffaires-suggest turns a partly typed word in body.query into matching free-text phrases and categories with their counts, so a search box can offer values body.category_id and body.query actually accept while the user is still typing. body.category_id also takes rubric_id or tree_id as alternative names, and sending it together with other filters in one call costs one extra request, because the category is resolved on its own first.
agriaffaires-locations resolves the geography the location filters accept: with no body.country it returns the list of countries, with one it returns that country's regions, and with body.region_id as well it returns that region's departments; each deeper level needs the level above it. agriaffaires-price-index keeps an entirely separate id space for the same brands.
Its body.rubric_id and body.make_id are not the category_id and manufacturer_id that agriaffaires-search and agriaffaires-facets use for the same rubric and make, and sending the wrong one returns an empty result rather than an error. The price band itself only appears once body.model and body.year, from 1900 to 2100, sit on top of both ids: a minimum, maximum and average asking price in euros, VAT-excluded, the same figure on every host.
{
"body": {
"market": "fr",
"query": "tracteur",
"manufacturer_id": 7607,
"year_min": 2018,
"price_max": 90000
}
}POST /api/v1/agriaffaires/<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).body.page accepts 1 to 200 on agriaffaires-search and agriaffaires-dealer-listings, and 1 to 400 on agriaffaires-dealers; a page past the limit is rejected rather than answered with an earlier page.agriaffaires-price-index keeps its own body.rubric_id and body.make_id values, separate from body.category_id and body.manufacturer_id; passing the wrong id returns an empty result rather than an error.body.region_id requires body.country, body.department_id requires body.region_id, and body.radius_km requires both body.postcode and body.country.body.dealer_id and body.listing_id take the numeric id exactly as agriaffaires-dealers, agriaffaires-search or a listing address prints it; account_id, id and ad_id are accepted as alternative names for them.body.site, body.market, body.country, body.listing_type, body.seller_type or body.sort value is rejected rather than replaced with a default.agriaffaires-search, a row's price sits in exactly one of price, auction_start_price, rental_price or other_type_price, never in more than one at once.latitude and longitude appear on agriaffaires-search rows for private-seller listings only, about half of them; dealer rows carry no coordinates.Call agriaffaires-categories with body.site set to agriaffaires or machineryzone; it returns each category's name, slug, url and category_id, together with its count. The id is language-invariant, so a category found under one body.market works on every national host of the same site. agriaffaires-facets and agriaffaires-suggest return matching category ids as well, which helps when you already have free text or a partly typed word instead of a tree to browse.
Send body.listing_id, the numeric id from a search row or a listing address, to agriaffaires-detail together with body.site and body.market. It returns the machine's manufacturer, model, year, condition, hour-meter reading and engine power, the price with its price_witness cross-check, every spec the seller typed, the images, the category breadcrumb and the dealer or private party behind the advert.
Call agriaffaires-price-index with no parameters to get its rubric list, then pass body.rubric_id to get that rubric's makes, body.rubric_id and body.make_id to get its models, and finally body.model and body.year on top to get the price band itself: price_min, price_max, price_average and the count of classified listings the figure rests on. These ids belong only to the price observatory and differ from the ids agriaffaires-search and agriaffaires-facets use for the same rubric and make.
body.site chooses which of the two catalogues agriaffaires-categories, agriaffaires-search and the other operations read: agriaffaires holds agricultural machinery such as tractors, harvesters, sprayers and balers, and machineryzone holds construction, earthmoving and handling machinery such as excavators, loaders, cranes and forklifts. They are separate catalogues on the same application, so a category_id or listing_id taken from one site does not exist on the other.
Pass body.manufacturer to resolve a brand by name against the facet list for your query, or body.manufacturer_id for the same brand's id from agriaffaires-facets, which costs one less request because no name resolution is needed. Add body.year_min and body.year_max for a year-of-construction window, and body.year_known set to true to drop listings that publish no year at all, since a year window alone also drops those rows.
Combine body.country and body.region_id, or body.department_id beneath a region, taken from agriaffaires-locations, with body.listing_type set to sale to exclude wanted adverts and auctions. For a radius instead of an administrative area, pass body.postcode with body.radius_km and body.country. Sorting by distance from the caller is not offered, because the position an API call would sort from is the calling server's, not the shopper's.
Send body.dealer_id, the numeric id agriaffaires-dealers and agriaffaires-search return, to agriaffaires-dealer with body.site set to machineryzone. It returns the dealer's name, activity, registration number, website, follower count, every branch address the group has, the manufacturer brands it carries and its stock broken down by category, each with its own count. account_id is accepted in place of body.dealer_id, and the same call with body.site set to agriaffaires reads the sibling catalogue instead.
Raise body.page by one on each call while keeping body.query, body.site, body.market and any filters identical, since changing any of them starts a different result list. agriaffaires-search holds 50 rows per page up to page 200; a page past that ceiling is rejected rather than quietly repeating page 1. Narrowing by category, manufacturer, year or price reaches further into a large result set than paging alone.