Discover/divar.ir API
live

divar.ir APIwww.divar.ir

Search Divar.ir classified ads by city, category, and keyword. Retrieve full listing details including price, location, images, and properties via two endpoints.

Endpoints
2
Updated
3h ago
Last verified
Try it
City slug for filtering posts. Accepted values: tehran, mashhad, karaj, shiraz, isfahan, ahvaz, tabriz, kermanshah, qom, rasht. Alternatively, pass a numeric city ID directly.
Maximum number of posts to return from the search results.
Free-text search query to match against post titles and descriptions. Empty string returns all recent posts.
Category slug to filter results. Use ROOT for all categories. Examples of category slugs: personal, clothing-and-shoes, clothing, vehicles, real-estate, digital-goods, home-kitchen, services, entertainment, industrial, jobs.
api.parse.bot/scraper/e66fc77c-35ea-444e-9f3a-be2eb642d380/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Use it in your codegrab a free API key at signup
curl -X POST 'https://api.parse.bot/scraper/e66fc77c-35ea-444e-9f3a-be2eb642d380/search_posts' \
  -H 'X-API-Key: $PARSE_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "city": "tehran",
  "limit": "10",
  "query": "موبایل",
  "category": "ROOT"
}'
All endpoints · 2 totalclick to expand

Search and list classified ad posts on Divar. Accepts a city slug, optional free-text query, and category filter. Returns a list of post summaries including title, price text, location, and image info. Results are sorted by newest first. Each post carries a token usable with get_post_details for the full listing.

Input
ParamTypeDescription
citystringCity slug for filtering posts. Accepted values: tehran, mashhad, karaj, shiraz, isfahan, ahvaz, tabriz, kermanshah, qom, rasht. Alternatively, pass a numeric city ID directly.
limitintegerMaximum number of posts to return from the search results.
querystringFree-text search query to match against post titles and descriptions. Empty string returns all recent posts.
categorystringCategory slug to filter results. Use ROOT for all categories. Examples of category slugs: personal, clothing-and-shoes, clothing, vehicles, real-estate, digital-goods, home-kitchen, services, entertainment, industrial, jobs.
Response
{
  "type": "object",
  "fields": {
    "posts": "array of post summary objects",
    "total_returned": "integer"
  },
  "sample": {
    "posts": [
      {
        "city": "تهران",
        "title": "سامسونگa07بنفش پک چین",
        "token": "Qa0ndl5h",
        "district": "آذری",
        "has_chat": true,
        "red_text": "پله شده",
        "image_url": "https://s100.divarcdn.com/static/photo/neda/webp_thumbnail/mwCrBQIeHkxQrSBiR7_qLw/8d89d358-f70d-4e31-96a9-96d5d6a6f75b.webp",
        "image_count": 2,
        "top_description": "نو",
        "bottom_description": "در آذری",
        "middle_description": "۲۲,۰۰۰,۰۰۰ تومان"
      }
    ],
    "total_returned": 5
  }
}

About the divar.ir API

The Divar.ir API provides access to Iran's largest classifieds marketplace through 2 endpoints. Use search_posts to query listings across 8 major Iranian cities filtered by category and free-text query, then call get_post_details with the returned token to retrieve a full listing record including price, description, geo-coordinates, item properties, and image URLs.

Search and Browse Listings

search_posts accepts three optional filters: a city slug (e.g. tehran, mashhad, tabriz), a category slug (e.g. personal, clothing-a, or ROOT for all categories), and a free-text query string matched against post titles and descriptions. Results are sorted newest-first and include a summary object per post with title, price text, location label, and image info. A limit parameter controls how many posts are returned. Each summary object carries a token field required by the detail endpoint.

Retrieve Full Listing Details

get_post_details takes a single required token string (obtained from search_posts results) and returns a structured record for that listing. Response fields include title, description, price (integer or null), city, district, status, a properties object of key-value attribute pairs (condition, item type, and other category-specific attributes), an images array with both url and thumbnail_url per image, and a location object with latitude and longitude when available.

Coverage and Scope

City coverage includes the eight slugs explicitly supported: tehran, mashhad, karaj, shiraz, isfahan, ahvaz, tabriz, and kerman. Category filtering uses Divar's own slug system; passing ROOT returns listings across all categories. Posts that have been removed or expired may return a non-active status. The properties object varies by listing category — a vehicle listing will carry different attributes than a real-estate or clothing listing.

Common use cases
  • Monitor price trends for a specific product category in Tehran or Mashhad by periodically calling search_posts
  • Build a cross-city price comparison tool using the price field returned by get_post_details
  • Aggregate geo-tagged listings using the latitude and longitude in the location object for a map-based classifieds browser
  • Track new listings in a category by querying search_posts sorted by newest-first and diffing tokens
  • Extract structured item attributes from the properties object to populate a product database
  • Collect thumbnail and full-resolution image URLs from the images array for visual listing previews
  • Feed listing titles and descriptions into a search index for a localized Iranian classifieds aggregator
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000250 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does Divar.ir have an official developer API?+
Divar does not publish a general-purpose public developer API. Access to listing data for third-party developers is not officially documented or available through a supported developer program.
What does get_post_details return beyond what search_posts provides?+
search_posts returns a summary per listing: title, price text, location label, and image info. get_post_details returns the full record for a single token: the integer price field, full description text, district, city, status, a properties object with category-specific key-value attributes, full-resolution and thumbnail image URLs, and a location object with latitude and longitude where available.
Which cities are supported, and can I search nationwide?+
The city parameter accepts eight slugs: tehran, mashhad, karaj, shiraz, isfahan, ahvaz, tabriz, and kerman. There is no current nationwide or all-cities parameter. You can fork the API on Parse and revise it to add support for additional city slugs if your use case requires other regions.
Does the API return seller contact information such as phone numbers?+
No seller contact details (phone numbers, usernames, or profile links) appear in the current response fields for either endpoint. The API covers listing content, attributes, images, and location. You can fork it on Parse and revise to add a contact-info endpoint if that data is accessible on individual listing pages.
How does pagination work for search_posts?+
search_posts exposes a limit parameter to control how many posts are returned in a single call. There is no cursor or page offset parameter currently exposed. If your use case requires paginated access to large result sets, you can fork the API on Parse and revise it to add offset-based or cursor-based pagination.
Page content last updated . Spec covers 2 endpoints from www.divar.ir.
Related APIs in MarketplaceSee all →
ebay.com API
Search and monitor eBay listings across any category, with support for active and completed/sold listings. Retrieve item details, pricing history, seller profiles and feedback, and category data. Filter by keyword, category, condition, seller, and sort order to support price research, market analysis, and inventory monitoring.
willhaben.at API
Search and browse listings across Austria's largest classifieds platform. Access marketplace goods, real estate (for sale and rent), cars, jobs, and full listing details — all from a single API.
mercadolibre.com.ar API
Search for products, cars, and real estate listings on MercadoLibre Argentina and access detailed information including product specifications, customer reviews, and seller profiles. Get comprehensive market data to compare prices, evaluate sellers, and make informed purchasing decisions across multiple categories.
mercadolibre.com API
Search and retrieve product listings, details, customer reviews, categories, and current deals from MercadoLibre across multiple countries to find the best products and prices. Get comprehensive product information including specifications and user feedback to make informed purchasing decisions.
jp.mercari.com API
Search and browse millions of product listings on Mercari Japan with bilingual support, filtering by categories and getting detailed pricing, item specifications, and seller information. Access comprehensive marketplace data including product summaries, category overviews, and individual seller profiles to find exactly what you're looking for.
finn.no API
Search and retrieve listings across Norwegian marketplaces on FINN.no, including vehicles, real estate, jobs, and second-hand items. Access structured listing data such as price, location, images, and category-specific attributes across all major FINN.no verticals.
etsy.com API
Discover what shoppers are searching for on Etsy by accessing real-time trending keywords and popular search terms that can help you identify market demand and optimize your product listings. Get instant access to autocomplete suggestions and "Popular right now" trends to stay ahead of customer interests and improve your shop's visibility.
craigslist.org API
Search and retrieve Craigslist listings for apartments, vehicles, jobs, services, and other categories across all regional sites to find exactly what you're looking for. Get detailed information about specific listings, browse by location and category, and compare options all in one place.