DEV Community

Cover image for How to Pull Akakçe Search Results into Python with Akakce Scraper
ReventaData
ReventaData

Posted on Originally published at apify.com

How to Pull Akakçe Search Results into Python with Akakce Scraper

A price comparison site lists many products for one word, one results page at a time. To keep the title, brand and price of each result in a spreadsheet you copy them by hand. This tutorial replaces that with a short Python script. It runs one search phrase on Akakçe and returns one row per result.

The tool is the Akakce Scraper Actor (reventadata/akakce-scraper). You call it from Python with the official apify-client package. The Actor reads public pages and needs no login. It is not affiliated with Akakçe.

By the end you will have a script that runs one search, saves the rows to a JSON file and turns them into a CSV file.


Prerequisites

  1. Python 3.11 or newer.
  2. The Apify API client for Python:
pip install -U "apify-client~=3.0"
Enter fullscreen mode Exit fullscreen mode
  1. An Apify account and your personal API token, set as an environment variable:
export APIFY_API_TOKEN="your_apify_token_here"
Enter fullscreen mode Exit fullscreen mode

The Actor needs no login. The token is only for the call from your script.


What you'll achieve

Each row is one result of the Akakçe product search in Turkey. The fields are:

  • id: the identifier published by the site.
  • title: the product title as published.
  • brand: the manufacturer published by the site. It can be empty.
  • price: the lowest price text the site shows, a text value.
  • url: the public product page URL. It can be empty.
  • matchedQuery: the phrase that found the item.
  • scrapedAt: an ISO 8601 timestamp of when the row was stored.

Example use case: search a phrase such as engineer and keep the title, brand and price text of each result in a file, then run the same search another day and compare the two files by scrapedAt.


Step 1: Open the Actor

Open the Akakce Scraper page on the Apify Store to read its description. This guide calls the Actor from Python, so the ID you need is reventadata/akakce-scraper.


Step 2: Set the inputs

Field Type What it does
query string Required. The phrase to look up in the Akakçe public product search, for example engineer.
maxItems integer Maximum number of results to save to the dataset. Minimum 1. Default 25.

query decides what is searched. maxItems decides when the Actor stops saving rows. A small value such as 10 is a good first test, because you can read every row.


Step 3: Run it from Python

import json
import os

from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_API_TOKEN"])

run_input = {"query": "engineer", "maxItems": 10}

run = client.actor("reventadata/akakce-scraper").call(run_input=run_input)
if run is None:
    raise SystemExit("The run did not start.")

print("Run status:", run.status)
items = client.dataset(run.default_dataset_id).list_items().items

for item in items:
    print(item["title"], "|", item.get("brand"), "|", item["price"], "|", item.get("url"))

with open("akakce-engineer-rows.json", "w", encoding="utf-8") as f:
    json.dump(items, f, indent=2, ensure_ascii=False)
Enter fullscreen mode Exit fullscreen mode

The call method starts the Actor and waits for it to finish. The run object has a status and the ID of the dataset that stores the rows. list_items().items returns the rows as a list of dictionaries. The loop prints one line per result and the last lines save every row to akakce-engineer-rows.json.

If the run did not start, call returns nothing, and the script stops with a message instead of failing later on an empty value. The loop reads brand and url with get because a row can have them empty.


Step 4: Read one row

The three rows below are the first three of the example run of 2026-11-27 (input {"query": "engineer", "maxItems": 10}, 10 rows in total). They are shown whole and unedited.

[
  {
    "id": "970855323",
    "title": "Secret Neighbor + Hello Engineer Nintendo Switch Oyunu",
    "brand": "Nintendo",
    "price": "2.899,00 TL",
    "url": "https://www.akakce.com/nintendo-oyunlari/en-ucuz-secret-neighbor-hello-engineer-nintendo-switch-oyunu-fiyati,970855323.html",
    "matchedQuery": "engineer",
    "scrapedAt": "2026-11-27T15:35:40.087632+00:00"
  },
  {
    "id": "1795438607",
    "title": "barsdepo Engineer Club Mühendis Temalı Baskılı Tişört - Kadın Mühendislere Özel Tasarım Unisex T-Shirt Premium Kalite",
    "brand": null,
    "price": "519,01 TL",
    "url": "https://www.akakce.com/tisort/en-ucuz-barsdepo-engineer-club-muhendis-temali-baskili-kadin-muhendislere-ozel-tasarim-unisex-t-shirt-premium-kalite-fiyati,1795438607.html",
    "matchedQuery": "engineer",
    "scrapedAt": "2026-11-27T15:35:40.087632+00:00"
  },
  {
    "id": "1778435893",
    "title": "Engineer's Accessories Köşeli Çelik Erkek Saati Turkuaz",
    "brand": null,
    "price": "890,00 TL",
    "url": null,
    "matchedQuery": "engineer",
    "scrapedAt": "2026-11-27T15:35:40.087632+00:00"
  }
]
Enter fullscreen mode Exit fullscreen mode

Notes on the fields:

  • The price value is text exactly as the site published it, so parse it yourself if you need a number.
  • brand and url were empty (null) in some of the rows above, so read them with item.get("name").
  • matchedQuery repeats the phrase you searched.
  • scrapedAt is a UTC timestamp. Every row of one run carries the same value in the example above.
  • id identifies the item, and url links to its page when the site published one.

Understanding your results

A row is a copy of what the site shows on one result card: a title, a brand when there is one, a price text and a link. Nothing in the row is calculated by the Actor. That has two consequences.

First, price is a string. In the example rows it holds the number and a TL suffix in one value, written the way the site published it. If you want to sort or compare prices, parse that text yourself and decide how to treat rows whose text has another shape. A simple approach is to keep the original text in one column and add a second column with your parsed number, so you can always see what the site published next to what your code made of it.

Second, a row only holds what the card published. The second and third example rows have no brand, and the third has no url, so code that must not stop on a missing value should read fields with item.get("name").


Pro tips and advanced usage

  • Save a CSV. The second script reads the JSON file back and writes a CSV with the columns you choose:
import csv
import json

with open("akakce-engineer-rows.json", encoding="utf-8") as f:
    items = json.load(f)

columns = ["id", "title", "brand", "price", "matchedQuery", "scrapedAt", "url"]
with open("akakce-engineer-rows.csv", "w", newline="", encoding="utf-8") as f:
    writer = csv.DictWriter(f, fieldnames=columns)
    writer.writeheader()
    for item in items:
        writer.writerow({name: item.get(name) for name in columns})
Enter fullscreen mode Exit fullscreen mode
  • Keep one file per day. Put the date in the file name and compare files later with scrapedAt.
  • Try several phrases. Run the script once per phrase. matchedQuery tells you which phrase produced each row when you merge the files.
  • Start small. Keep maxItems low until the first rows look right, then raise it.
  • Check a link by hand. Open a few url values in a browser and compare the title and the price text with the row, now and then.
  • Dedupe on id. An item can appear under two phrases when you merge files, so key merged data by id.

Limits to know

  • One search phrase is read per run, and one results page is read per search. That page held at most 32 results when measured on 2026-11-27.
  • A phrase with no public results stores no rows.
  • query is required and can be at most 120 characters. maxItems must be 1 or more, and defaults to 25.
  • Only fields the site publishes are returned. Nothing sits behind a login.
  • The same id is stored once per run.

Troubleshooting common issues

  • The run stops with a message and no rows: check that query is not empty and is within 120 characters, and that maxItems is at least 1.
  • The run succeeds with no rows: the phrase had no public results. Try a broader phrase.
  • The run fails with a message about the site: the site refused the run. Wait and run it again. The run log shows the message the Actor wrote.
  • A row shows an empty field: the site did not publish it. Read it with item.get("name") as shown above.
  • The status is not a success: read the run log in the Apify Console. The Actor writes the reason there.

Next steps

Run the script on a schedule with your own cron job or a scheduler, keep the files, and compare them across dates. Try other phrases and a larger maxItems. The Apify Python client documentation covers the rest of the client.

For current pricing and details, see the Store page.

About the author: reventadata builds and publishes data extraction Actors on the Apify Store.

Top comments (0)