# Eksi Sozluk Scraper (`epctex/eksisozluk-scraper`) Actor

- **URL**: https://apify.com/epctex/eksisozluk-scraper.md
- **Developed by:** [epctex](https://apify.com/epctex) (community)
- **Categories:** Social media, News
- **Stats:** 73 total users, 6 monthly users, 99.2% runs succeeded, 12 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.90 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Actor - Eksi Sozluk Scraper

Ekşi Sözlük, a vibrant community-driven platform, lacks a robust and freely accessible API. To bridge this gap, we present the Ekşi Sözlük Scraper, designed to facilitate seamless data extraction and analysis from this popular Turkish platform.

- **Flexible Keyword Search**: Effortlessly search for any keyword and retrieve relevant entries. Refine your search with options like author name, specific date ranges, and sorting orders to pinpoint the information you need.

- **User-Centric Scraping**: Dive deep into users' contributions by scraping entries made by specific individuals, gaining insights into their perspectives and contributions.

- **Entry and Topic Scraping**: Fetch content from specific entries or gather entries related to specific topics or issues, enabling comprehensive research and analysis.

- **Customizable Search Parameters**: Tailor your search with parameters such as start date, end date, nice-only entries, and search sort order for a personalized scraping experience.

#### Important Note

The website has a very strong geo-targeting at the current moment. It allows the requests only from Turkish IPs. Please use custom proxies, or ask Apify team to provide you some.

### Bugs, fixes, updates, and changelog

This scraper is under active development. If you have any feature requests you can create an issue from [here](https://github.com/epctex-support/eksisozluk-scraper/issues).

### Input Parameters

The input of this scraper should be JSON containing the list of pages on Eksi Sozluk that should be visited. Required fields are:

- `startUrls`: (Optional) (Array) List of Eksi Sozluk URLs. You should only provide a topics, issues, users or entries URLs.

- `endPage`: (Optional) (Number) Final number of page that you want to scrape. The default is `Infinite`. This applies to all `search` requests and `startUrls` individually.

- `maxItems`: (Optional) (Number) You can limit scraped items. This should be useful when you search through the big lists or search results.

- `searchKeyword`: (Optional) (String) Keyword that you want to search on Eksi Sozluk.

- `searchAuthor`: (Optional) (String) Keyword that you want to search by author name on Eksi Sozluk.

- `searchStartDate`: (Optional) (String) The start date you can type when you want to search any date range on Eksi Sozluk.

- `searchEndDate`: (Optional) (String) The end date you can type when you want to search any date range on Eksi Sozluk.

- `isSearchNiceOnly`: (Optional) (Boolean) If you want to search nice only, you can set `true`. Default setting is `false`.

- `searchSortOrder`: (Optional) (String) The search sort order you can type when you want to sort the results. The default setting is `Date`.

  - `Date`: Sorts from new to old.
  - `Count`: Sorts from most to least.
  - `Topic`: Sorts alphabetically.

- `proxy`: (Required) (Proxy Object) Proxy configuration.

- `extendOutputFunction`: (Optional) (String) Function that takes a JQuery handle ($) as an argument and returns an object with data.

- `customMapFunction`: (Optional) (String) Function that takes each object's handle as an argument and returns the object with executing the function.

This solution requires the use of **Proxy servers**, either your own proxy servers or you can use [Apify Proxy](https://www.apify.com/docs/proxy).

#### Tip

When you want to scrape over a specific list URL, just copy and paste the link as one of the **startUrl**.

If you would like to scrape only the first page of a list then put the link for the page and have the `endPage` as 1.

With the last approach that is explained above you can also fetch any interval of pages. If you provide the 5th page of a list and define the `endPage` parameter as 6 then you'll have the 5th and 6th pages only.

#### Compute Unit Consumption

The actor is optimized to run blazing fast and scrape as many items as possible. Therefore, it forefronts all the detailed requests. If the actor doesn't block very often it'll scrape 100 listings in 2 minutes with ~0.01-0.15 compute units.

#### Eksi Sozluk Scraper Input example

```json
{
    "startUrls": [
        "https://eksisozluk.com/biri/elmyra",
        "https://eksisozluk.com/basliklar/gundem",
        "https://eksisozluk.com/istanbul--32102",
        "https://eksisozluk.com/entry/21381787"
    ],
    "maxItems": 20,
    "searchKeyword": "eksi",
    "searchAuthor": "ssg",
    "searchStartDate": "26-07-2013",
    "searchEndDate": "30-07-2013",
    "isSearchNiceOnly": true,
    "searchSortOrder": "Date",
    "proxy":{
        "useApifyProxy": true
    }
}

```

### During the Run

During the run, the actor will output messages letting you know what is going on. Each message always contains a short label specifying which page from the provided list is currently specified.
When items are loaded from the page, you should see a message about this event with a loaded item count and total item count for each page.

If you provide incorrect input to the actor, it will immediately stop with a failure state and output an explanation of what is wrong.

### Eksi Sozluk Export

During the run, the actor stores results into a dataset. Each item is a separate item in the dataset.

You can manage the results in any language (Python, PHP, Node JS/NPM). See the FAQ or <a href="https://www.apify.com/docs/api" target="blank">our API reference</a> to learn more about getting results from this Eksi Sozluk actor.

### Scraped Eksi Sozluk Properties

The structure of each item in Eksi Sozluk looks like this:

#### Item Detail

```json
{
	"type": "entry",
	"issueUrl": "https:/www.eksisozluk.com/eksi-sozluk-hakkindaki-akademik-calismalar--2131734",
	"entryId": "110286085",
	"authorId": "8097",
	"authorName": "ssg",
	"authorUrl": "https:/www.eksisozluk.com/biri/ssg",
	"authorAvatar": "https://img.ekstat.com/profiles/ssg-638271629469815122.jpg",
	"issueTitle": "ekşi sözlük hakkındaki akademik çalışmalar",
	"entryUrl": "https:/www.eksisozluk.com/entry/110286085",
	"content": "web-based macroseismic intensity study in turkey: entries in ekşi sözlük, deniz ertuncay, laura cataldi, and giovanni costa, 2020 <a rel=\"nofollow noopener\" class=\"url\" target=\"_blank\" href=\"https://gc.copernicus.org/preprints/gc-2020-31/\">https://gc.copernicus.org/preprints/gc-2020-31/</a>",
	"date": "16.07.2020 21:19",
	"favoriteCount": "17"
}
```

### Contact

Please visit us through [epctex.com](https://epctex.com) to see all the products that are available for you. If you are looking for any custom integration or so, please reach out to us through the chat box in [epctex.com](https://epctex.com). In need of support? <business@epctex.com> is at your service.

# Actor input Schema

## `startUrls` (type: `array`):

URLs to start with. It can be user, topic, issue or entry URLs.

## `searchKeyword` (type: `string`):

The keyword that you can search on Eksi Sozluk

## `searchAuthor` (type: `string`):

Author name for a refined search on Eksi Sozluk.

## `searchStartDate` (type: `string`):

Start date for a refined date-range search on Eksi Sozluk.

## `searchEndDate` (type: `string`):

End date for a refined date-range search on Eksi Sozluk.

## `isSearchNiceOnly` (type: `boolean`):

Search nice only entries

## `searchSortOrder` (type: `string`):

Sorting to get more refined search results on Eksi Sozluk

## `endPage` (type: `integer`):

The page number that you want to end with. By default there is no end page. This is applies to all search request and startUrls individually.

## `maxItems` (type: `integer`):

Maximum number of listing entries that you want as output. Default is all

## `proxy` (type: `object`):

Select proxies to be used by your crawler.

## `extendOutputFunction` (type: `string`):

Function that takes a JQuery handle ($) as argument and returns data that will be merged with the default output

## `customMapFunction` (type: `string`):

Function that takes each of the objects as argument and returns data that will be mapped by the function itself.

## Actor input object example

```json
{
  "startUrls": [
    "https://eksisozluk.com/biri/elmyra",
    "https://eksisozluk.com/basliklar/gundem",
    "https://eksisozluk.com/istanbul--32102",
    "https://eksisozluk.com/entry/21381787"
  ],
  "searchKeyword": "eksisozluk",
  "isSearchNiceOnly": false,
  "searchSortOrder": "Date",
  "endPage": 1,
  "maxItems": 20,
  "proxy": {
    "useApifyProxy": true
  },
  "extendOutputFunction": "($) => { return {} }",
  "customMapFunction": "(object) => { return {...object} }"
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        "https://eksisozluk.com/biri/elmyra",
        "https://eksisozluk.com/basliklar/gundem",
        "https://eksisozluk.com/istanbul--32102",
        "https://eksisozluk.com/entry/21381787"
    ],
    "searchKeyword": "eksisozluk",
    "endPage": 1,
    "maxItems": 20,
    "proxy": {
        "useApifyProxy": true
    },
    "extendOutputFunction": ($) => { return {} },
    "customMapFunction": (object) => { return {...object} }
};

// Run the Actor and wait for it to finish
const run = await client.actor("epctex/eksisozluk-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "startUrls": [
        "https://eksisozluk.com/biri/elmyra",
        "https://eksisozluk.com/basliklar/gundem",
        "https://eksisozluk.com/istanbul--32102",
        "https://eksisozluk.com/entry/21381787",
    ],
    "searchKeyword": "eksisozluk",
    "endPage": 1,
    "maxItems": 20,
    "proxy": { "useApifyProxy": True },
    "extendOutputFunction": "($) => { return {} }",
    "customMapFunction": "(object) => { return {...object} }",
}

# Run the Actor and wait for it to finish
run = client.actor("epctex/eksisozluk-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    "https://eksisozluk.com/biri/elmyra",
    "https://eksisozluk.com/basliklar/gundem",
    "https://eksisozluk.com/istanbul--32102",
    "https://eksisozluk.com/entry/21381787"
  ],
  "searchKeyword": "eksisozluk",
  "endPage": 1,
  "maxItems": 20,
  "proxy": {
    "useApifyProxy": true
  },
  "extendOutputFunction": "($) => { return {} }",
  "customMapFunction": "(object) => { return {...object} }"
}' |
apify call epctex/eksisozluk-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,epctex/eksisozluk-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/G15VxcXuAgpxulpQy/builds/m3lkbzHE9ZLEBAxn7/openapi.json
