Skip to content

Guide

How to scrape Trendyol product data and seller prices with an API

Pull Trendyol search results, a store's listings and every seller's price for a product as JSON, with three API calls and working Python code.

Published 2 December 2026

Trendyol is Turkey's largest online marketplace, and most price, assortment and seller questions about Turkish e-commerce start there. This guide shows how to read Trendyol data as structured JSON with the Datafor API: search results for a keyword or barcode, every listing of a store, and the price of every seller that offers one product.

You need a Datafor API key. New accounts get 50 free credits after email verification, and each Trendyol run costs 1 credit. Failed runs are refunded automatically.

The three Trendyol scrapers

Every Datafor scraper runs through one endpoint, POST https://api.datafor.dev/v1/run, with your key in the x-api-key header. You choose the scraper with script_name and pass its options in params.

  • trendyol_search: search results for a keyword or barcode, up to 3 pages per run.
  • trendyol_store_products: the listings of one store, by merchant id or store URL, up to 3 pages per run.
  • trendyol_product_detail: one product with the price, stock and free-shipping flag of every seller that offers it.

Step 1: search Trendyol by keyword or barcode

trendyol_search takes a query, an optional number of pages (1 to 3) and an optional sort. The sort orders are SCORE (relevance, the default), PRICE_BY_ASC, PRICE_BY_DESC, MOST_RECENT, BEST_SELLER, MOST_FAVOURITE and MOST_RATED.

curl
curl -X POST https://api.datafor.dev/v1/run \
  -H "Content-Type: application/json" \
  -H "x-api-key: $DATAFOR_API_KEY" \
  -d '{
    "script_name": "trendyol_search",
    "params": { "query": "kahve makinesi", "pages": 1, "sort": "BEST_SELLER" }
  }'

The response is the standard Datafor envelope: correlation_id, transaction_id, script_name, cost, balance_after and the scraper output in result. For a search, result.products holds one object per listing with rank, page, id, title, brand, url, image, price, original_price, currency (TRY), rating, rating_count, merchant_id and category. result.summary adds the total count and the cheapest and most expensive price on the pages you fetched.

Step 2: list every product of a store

To track a competitor's assortment, pass a merchant id (for example 968) or a Trendyol store URL that contains mid= to trendyol_store_products. The default sort for stores is BEST_SELLER.

python
import os
import requests

API = "https://api.datafor.dev/v1/run"
HEADERS = {"x-api-key": os.environ["DATAFOR_API_KEY"]}

def run(script_name, params):
    response = requests.post(API, headers=HEADERS, json={"script_name": script_name, "params": params}, timeout=180)
    response.raise_for_status()
    return response.json()["result"]

store = run("trendyol_store_products", {"store": "968", "pages": 3})
for product in store["products"]:
    print(product["rank"], product["title"], product["price"])

The store scraper reads the listing pages only. It does not open each product, so a 3-page run is still 1 credit.

Step 3: compare every seller's price for one product

The same product is often sold by several sellers, and Trendyol shows one of them as the winning offer (the buybox). trendyol_product_detail takes a product id or a full product URL and returns all of them.

python
detail = run("trendyol_product_detail", {"product": "990828141"})

print(detail["product"]["title"], "-", detail["summary"]["total_offers"], "sellers")
print("Lowest price:", detail["summary"]["lowest_price"], "Winning price:", detail["summary"]["winner_price"])

for offer in sorted(detail["offers"], key=lambda o: o["price"] or 0):
    flag = "WINNER" if offer["is_winner"] else ""
    print(offer["merchant_name"], offer["price"], "in stock" if offer["in_stock"] else "out of stock", flag)

Each offer has merchant_id, merchant_name, seller_score, price, original_price, in_stock, free_cargo and is_winner. The product object carries the title, brand, category, images, rating and rating count.

Building a simple price monitor

Datafor does not schedule runs for you yet, so price monitoring means calling the API from your own scheduler (cron, a queue worker or a workflow tool) and storing the results:

  1. Keep a list of product ids or URLs you care about.
  2. Once or twice a day, call trendyol_product_detail for each one and save summary.lowest_price, summary.winner_price and the offers with a timestamp.
  3. Compare with the previous run and alert when your price is no longer the winner or a competitor drops below a threshold.

At 1 credit per product per check, 200 products checked twice a day is about 12,000 credits a month, which fits the Developer plan's 10,000 included credits plus a small overage, or the Pro plan. See the price per 1,000 runs for each plan.

Using it from an AI agent

The same three scrapers are tools in the Datafor MCP server. Connect it to Claude, Cursor or Codex and ask in plain language, for example "Find the five best-selling coffee machines on Trendyol and list every seller's price for the top one". The agent calls trendyol_search and trendyol_product_detail for you.

Limits to know

  • Up to 3 result pages per search or store run; fetch more by narrowing the query or sorting differently.
  • Category pages and built-in price alerts are not available yet.
  • Prices are in Turkish lira, as shown on trendyol.com.
  • Read the data sources and acceptable use page before you build on scraped data.

The full parameter list for every scraper is in the API reference, and the Trendyol API page has a live example you can run.

← All guides