# Stack Overflow & Stack Exchange Scraper - Q\&A, Users & Tags (`scrapesage/stackexchange-scraper`) Actor

Scrape Stack Overflow & 360+ Stack Exchange sites: questions, answers, tags & full-text search with full body, votes, views & owners. Get developer leads (top users with location, website, socials & reputation). Monitor new questions. No login.

- **URL**: https://apify.com/scrapesage/stackexchange-scraper.md
- **Developed by:** [Scrape Sage](https://apify.com/scrapesage) (community)
- **Categories:** Lead generation, Agents, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 question scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Stack Overflow & Stack Exchange Scraper — Q\&A, Users & Tags

Extract **complete Stack Overflow and Stack Exchange data** — questions, answers, tags, full-text search results, and **developer leads** — across **360+ Q\&A sites** (Stack Overflow, Server Fault, Super User, Ask Ubuntu, Mathematics, Data Science, DevOps, Security, DBA, Code Review, Software Engineering, Unix & Linux, and more).

Every record ships the **full body** (HTML, Markdown and clean plain text), votes, views, owner, timestamps and a direct link. Turn high-reputation contributors into **ready-to-contact developer leads** with location, personal website, bio, socials and — optionally — emails and phone numbers crawled from their own site.

No login, no cookies, no browser — fast JSON extraction from the official Stack Exchange API with 99%+ reliability.

### Why this Stack Exchange scraper?

Most scrapers in this space return only a thin slice (titles + scores) of a single site. This actor pulls the **richest dataset in the category** from the whole Stack Exchange network and adds a lead-gen layer no other scraper offers:

| Data | Typical scrapers | This actor |
|---|---|---|
| Question full body (HTML + Markdown + text) | partial | ✅ |
| Votes, views, answer count, accepted answer | ✅ | ✅ |
| Answers with full body + accepted flag | ❌ | ✅ opt-in |
| Comment threads on questions & answers | ❌ | ✅ opt-in |
| Tags with counts, synonyms, wiki & top users | partial | ✅ |
| Full-text advanced search (any site) | partial | ✅ |
| Developer profiles: reputation, location, website, bio | ❌ | ✅ |
| Developer **emails / phone** (from their website) | ❌ | ✅ opt-in |
| Developer socials (GitHub, X, LinkedIn, …) + lead score | ❌ | ✅ |
| 360+ sites, not just Stack Overflow | ❌ | ✅ |
| Monitor mode — only new questions/answers | ❌ | ✅ |

### Use cases

- **Developer lead generation** — recruiters and dev-tool / DevRel teams find the highest-reputation contributors for a technology (e.g. top `kubernetes`, `rust`, or `react` answerers), score them by reputation and reach them via their website, socials and emails.
- **Community & support monitoring** — watch your product's tag (e.g. `firebase`, `stripe-payments`, `next.js`) and get alerted to every new question so you can answer first.
- **Market & technology research** — measure technology demand and trends with tag question counts, search volume and activity over time across the whole network.
- **Content & SEO** — mine the most-voted, most-viewed questions on a topic to plan documentation, tutorials and knowledge-base articles.
- **Training data & RAG** — export clean Q\&A pairs (question + accepted answer, with content license) as LLM-ready JSON for fine-tuning or retrieval.
- **Competitive intelligence** — track questions and sentiment around competitor products and libraries.

### How to use

1. [Sign up for Apify](https://console.apify.com/sign-up) — the free plan is enough to try this actor.
2. Open the **Stack Overflow & Stack Exchange Scraper**, pick a **mode** (search / questions / answers / users / tags), set a **site** and your query or tags (or paste Stack Exchange URLs), then click **Start**.
3. Watch results stream into the dataset table.
4. **Export** as JSON, CSV, Excel, XML, or RSS — or pull results programmatically via the [Apify API](https://docs.apify.com/api/v2).

### Input

```json
{
    "mode": "search",
    "site": "stackoverflow",
    "searchQuery": "fastapi async background task",
    "tags": ["python", "fastapi"],
    "sort": "votes",
    "minAnswers": 1,
    "includeAnswers": true,
    "includeBodyMarkdown": true,
    "maxItems": 100
}
```

Find the top developers for a technology and enrich them into leads:

```json
{
    "mode": "users",
    "site": "stackoverflow",
    "sort": "reputation",
    "includeUserTopTags": true,
    "enrichUserContacts": true,
    "maxItems": 50
}
```

- **mode** — `search` (full-text), `questions` (browse by tag/date/votes), `answers`, `users` (developer leads), or `tags`.
- **site** — any Stack Exchange site's API parameter: `stackoverflow`, `serverfault`, `superuser`, `askubuntu`, `math`, `datascience`, `devops`, `security`, `dba`, `codereview`, `softwareengineering`, `unix`, `apple`, `ux`, … (360+ supported).
- **searchQuery** — free-text query for `search` mode.
- **tags** — filter questions by tag(s) (ALL must match), or look up tags directly in `tags` mode.
- **questionIds / userIds / userName** — fetch specific posts, specific developers, or search developers by name.
- **startUrls** — paste question, answer, user, tag or search URLs from any Stack Exchange site; the site is auto-detected.
- **sort / order / acceptedOnly / minAnswers / fromDate / toDate** — ordering and filters.
- **includeAnswers** *(default false)* — also emit each question's answers as separate records.
- **includeComments** *(default false)* — attach comment threads to questions/answers.
- **includeUserTopTags** *(default false)* — add each developer's top tags by answer score.
- **includeTagDetails** *(default false)* — add each tag's wiki excerpt + all-time top answerers & askers.
- **enrichUserContacts** *(default false)* — crawl each developer's website for emails, phone and socials, then assign a 0–100 lead score.
- **monitorMode / monitorKey** — remember IDs across runs and output only new items (for scheduled alerts).
- **apiKey** *(optional)* — a free [Stack Apps key](https://stackapps.com/apps/oauth/register) raises the daily quota from 300 to 10,000 requests. The actor works without one.

### Output

One record per item, tagged with a `type` field. **Question** (`type: "question"`):

```json
{
    "type": "question",
    "site": "stackoverflow",
    "questionId": 231767,
    "title": "What does the \"yield\" keyword do in Python?",
    "url": "https://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do-in-python",
    "tags": ["python", "iterator", "generator", "yield"],
    "score": 13135,
    "viewCount": 3494429,
    "answerCount": 51,
    "isAnswered": true,
    "acceptedAnswerId": 231855,
    "creationDate": "2008-10-23T22:21:11.000Z",
    "lastActivityDate": "2026-02-14T09:12:00.000Z",
    "contentLicense": "CC BY-SA 4.0",
    "body": "I want to understand what the yield keyword does…",
    "bodyMarkdown": "I want to understand what the `yield` keyword does…",
    "ownerName": "Alex. S.",
    "owner": { "userId": 19302, "displayName": "Alex. S.", "reputation": 16542, "link": "https://stackoverflow.com/users/19302/alex-s" },
    "scrapedAt": "2026-06-17T21:00:00.000Z"
}
```

**Developer lead** (`type: "user"`):

```json
{
    "type": "user",
    "site": "stackoverflow",
    "userId": 22656,
    "displayName": "Jon Skeet",
    "profileUrl": "https://stackoverflow.com/users/22656/jon-skeet",
    "reputation": 1528055,
    "location": "Reading, United Kingdom",
    "website": "http://csharpindepth.com",
    "aboutMe": "Author of C# in Depth…",
    "badgeCounts": { "gold": 895, "silver": 9318, "bronze": 9357 },
    "answerCount": 35802,
    "questionCount": 56,
    "topTags": [{ "tag": "c#", "answerScore": 250000, "answerCount": 22000 }],
    "emails": ["skeet@example.com"],
    "socialLinks": { "github": "https://github.com/jskeet", "twitter": "https://twitter.com/jonskeet" },
    "leadScore": 86,
    "scrapedAt": "2026-06-17T21:00:00.000Z"
}
```

Plus optional **answer** (`type: "answer"`) records with full body, score and accepted flag, and **tag** (`type: "tag"`) records with count, synonyms, wiki and top users.

### Automate & schedule

Run this actor on autopilot and pull results into your own stack:

- **[Apify API](https://docs.apify.com/api/v2)** — start runs, fetch datasets, and manage schedules over REST.
- **[apify-client for JavaScript](https://docs.apify.com/api/client/js/)** and **[apify-client for Python](https://docs.apify.com/api/client/python/)** — official SDKs.
- **[Schedules](https://docs.apify.com/platform/schedules)** — run it hourly/daily to monitor new questions on a tag or new answers from a competitor; perfect for support queues and lead pipelines. Pair with **monitor mode** to emit only items you haven't seen.
- **[Webhooks](https://docs.apify.com/platform/integrations/webhooks)** — trigger downstream actions (CRM import, Slack alert, ticket creation) the moment a run finishes.

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

const client = new ApifyClient({ token: 'MY_APIFY_TOKEN' });

const run = await client.actor('scrapesage/stackexchange-scraper').call({
    mode: 'users',
    site: 'stackoverflow',
    sort: 'reputation',
    enrichUserContacts: true,
    maxItems: 50,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Got ${items.length} developer leads`);
```

### Integrate with any app

Connect the dataset to 5,000+ apps — no code required:

- **[Make](https://docs.apify.com/platform/integrations/make)** — multi-step automation scenarios.
- **[Zapier](https://docs.apify.com/platform/integrations/zapier)** — push new developer leads straight into your CRM.
- **[Slack](https://docs.apify.com/platform/integrations/slack)** — get notified when a monitored tag gets a new question.
- **[Google Drive / Sheets](https://docs.apify.com/platform/integrations/drive)** — auto-export every run to a spreadsheet.
- **[Airbyte](https://docs.apify.com/platform/integrations/airbyte)** — pipe results into your data warehouse.
- **[GitHub](https://docs.apify.com/platform/integrations/github)** — trigger runs from commits or releases.

### Use with AI assistants (MCP)

The output is clean, LLM-ready JSON. You can call this actor from Claude, ChatGPT, or any agent framework through the **[Apify MCP server](https://docs.apify.com/platform/integrations/mcp)** — ask your assistant to "find the top 20 Kubernetes contributors on Stack Overflow and list their websites" and let it run this scraper for you.

### Agent-ready: autonomous payments (x402 & Skyfire)

This actor is **agent-ready** — AI agents can discover it, run it, and **pay for it autonomously**, with no Apify account and no human in the loop. It uses [pay-per-event](https://docs.apify.com/platform/actors/publishing/monetize/pay-per-event) pricing and [limited permissions](https://docs.apify.com/platform/actors/development/permissions), so it qualifies for Apify's agentic-payment standards:

- **[x402](https://docs.apify.com/platform/integrations/x402)** — an open, HTTP-native payment protocol. Agents pay per run in USDC on the Base network directly through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) — no account, no API key.
- **[Skyfire](https://docs.apify.com/platform/integrations/skyfire)** — agent-to-service payments for fully autonomous AI-agent workflows.

Building an AI agent, MCP tool, or autonomous data pipeline? This scraper is ready to plug in and pay as it goes.

### More scrapers from scrapesage

Build a complete **developer-intelligence & dev-lead stack** with the rest of the cluster:

- **[GitHub Scraper](https://apify.com/scrapesage/github-scraper)** — repos, contributors, stars and developer leads from GitHub.
- **[Hugging Face Scraper](https://apify.com/scrapesage/hugging-face-scraper)** — AI models, datasets and creator profiles.
- **[Product Hunt Scraper](https://apify.com/scrapesage/product-hunt-scraper)** — launches, makers and product data.
- **[Chrome Web Store Scraper](https://apify.com/scrapesage/chrome-web-store-scraper)** — extensions, ratings and developer contacts.
- **[Google Patents Scraper](https://apify.com/scrapesage/google-patents-scraper)** — patents, inventors and assignees.
- **[YouTube Scraper](https://apify.com/scrapesage/youtube-scraper)** — channels, videos and creator leads.
- **[Linktree Scraper](https://apify.com/scrapesage/linktree-scraper)** — creator bio links, emails and leads.
- **[Website Contact Scraper](https://apify.com/scrapesage/website-contact-scraper)** — emails, phones and socials from any domain list.

### Tips

- **Quota**: keyless runs share Stack Exchange's 300-requests/day-per-IP limit; the actor rotates a fresh proxy IP per request to spread it. For large or frequent runs, add a free **apiKey** (10,000/day).
- **Whole network**: change `site` to scrape Server Fault, Super User, Ask Ubuntu, Math, Data Science, DevOps, Security, and 350+ more — the same modes work everywhere.
- **Monitoring**: turn on **monitorMode** with a unique **monitorKey** and a daily [Schedule](https://docs.apify.com/platform/schedules) to get only newly posted questions on a tag.
- **Cost control**: answers and comments are opt-in; contact enrichment only runs for developers who actually list a website.

### FAQ

**Do I need a Stack Exchange API key?** No. The actor works keyless out of the box. An optional free key only raises the daily request quota for heavy use.

**Which sites are supported?** All 360+ sites on the Stack Exchange network — pass the site's API parameter (e.g. `stackoverflow`, `serverfault`, `math`, `datascience`) or just paste a URL and let the actor detect it.

**Where do developer emails come from?** Never from Stack Exchange directly. With `enrichUserContacts` on, the actor visits the developer's own public website (the one they list on their profile) and extracts publicly listed contact details — the same thing a human visitor would see.

**Can I export to Google Sheets, CSV, or Excel?** Yes — one click in the dataset view, or automatically on every run via the [Google Drive integration](https://docs.apify.com/platform/integrations/drive).

**How do I monitor new questions automatically?** Turn on monitor mode, then create a [Schedule](https://docs.apify.com/platform/schedules) (e.g. daily) and optionally add a [webhook](https://docs.apify.com/platform/integrations/webhooks) or [Zapier zap](https://docs.apify.com/platform/integrations/zapier) to push new items into Slack or your CRM.

**Is scraping Stack Exchange legal?** This actor uses the official public Stack Exchange API and collects publicly available data only. Content is licensed under Creative Commons (the `contentLicense` field tells you which version) — attribute it accordingly. You are responsible for complying with applicable laws (GDPR/CCPA for personal data) and the Stack Exchange terms.

**A field is null — why?** Some questions have no accepted answer, some developers list no website or location. Fields are `null` only when the data genuinely doesn't exist, not because the scraper skipped them.

### Need help?

Open an issue on the actor's **Issues** tab, or visit the [Apify help center](https://help.apify.com/). Feature requests are welcome — this actor is actively maintained.

# Actor input Schema

## `mode` (type: `string`):

What to scrape. <code>search</code> = full-text search for questions (default). <code>questions</code> = browse questions by tag / newest / most-voted / unanswered. <code>answers</code> = answers (by question, by user, or network-wide). <code>users</code> = developer leads (top users, by name, or by id). <code>tags</code> = tags with counts, synonyms & wiki.

## `site` (type: `string`):

Which Stack Exchange site to scrape (the API site parameter). Examples: <code>stackoverflow</code>, <code>serverfault</code>, <code>superuser</code>, <code>askubuntu</code>, <code>math</code>, <code>math.meta</code>, <code>datascience</code>, <code>devops</code>, <code>security</code>, <code>dba</code>, <code>codereview</code>, <code>softwareengineering</code>, <code>unix</code>, <code>apple</code>, <code>gaming</code>, <code>ux</code>. 360+ sites supported. Auto-detected from Start URLs when those are used.

## `searchQuery` (type: `string`):

Full-text query for <code>search</code> mode — matched against question titles & bodies (e.g. <code>fastapi async background task</code>). Leave empty to browse by tag/date instead.

## `tags` (type: `array`):

Tags to filter by (e.g. <code>python</code>, <code>kubernetes</code>, <code>react</code>). In <code>search</code>/<code>questions</code> mode a question must carry ALL listed tags. In <code>tags</code> mode these are looked up directly (counts, synonyms, wiki).

## `questionIds` (type: `array`):

Specific question IDs to fetch (numeric, e.g. <code>231767</code>). In <code>questions</code> mode returns those questions; in <code>answers</code> mode returns their answers.

## `userIds` (type: `array`):

Specific user IDs to fetch (numeric, e.g. <code>22656</code>). In <code>users</code> mode returns those developer leads; in <code>answers</code> mode returns those users' answers.

## `userName` (type: `string`):

In <code>users</code> mode, find users whose display name matches this text (e.g. <code>jon skeet</code>). Leave empty to list the highest-reputation users on the site.

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

Paste Stack Exchange URLs to scrape directly — question pages (<code>/questions/123/...</code>), answer permalinks (<code>/a/456</code>), user profiles (<code>/users/789/...</code>), tag pages (<code>/questions/tagged/python</code>) or search pages (<code>/search?q=...</code>). The site is auto-detected from each URL's host (stackoverflow.com, serverfault.com, \*.stackexchange.com, askubuntu.com, mathoverflow.net, …).

## `sort` (type: `string`):

Result ordering. For questions/search: <code>votes</code>, <code>activity</code>, <code>creation</code> (newest), <code>hot</code>, <code>week</code>, <code>month</code> (relevance is used automatically when a search query is given). For users: <code>reputation</code>, <code>creation</code>, <code>name</code>, <code>modified</code>. For tags: <code>popular</code>, <code>activity</code>, <code>name</code>.

## `order` (type: `string`):

Sort direction.

## `acceptedOnly` (type: `boolean`):

In <code>search</code> mode, only return questions that have an accepted answer.

## `minAnswers` (type: `integer`):

In <code>search</code> mode, only return questions with at least this many answers (e.g. <code>1</code> to skip unanswered questions).

## `fromDate` (type: `string`):

Only include items created on/after this date (YYYY-MM-DD). Great for daily monitoring runs.

## `toDate` (type: `string`):

Only include items created on/before this date (YYYY-MM-DD).

## `includeAnswers` (type: `boolean`):

In <code>search</code>/<code>questions</code> mode, also fetch each question's answers and emit them as separate <code>answer</code> records (full body, score, accepted flag, owner). Charged per answer.

## `includeComments` (type: `boolean`):

Attach the comment thread (body, owner, score) to each question/answer record. Comments are nested into the record (no separate charge).

## `includeUserTopTags` (type: `boolean`):

In <code>users</code> mode, fetch each developer's top tags by answer score (one extra request per user). Adds <code>topTags</code> to the lead record.

## `includeTagDetails` (type: `boolean`):

In <code>tags</code> mode, also fetch each tag's wiki excerpt and its all-time top answerers and askers (extra requests per tag).

## `enrichUserContacts` (type: `boolean`):

In <code>users</code> mode, crawl each developer's personal website (home + contact/about, up to 3 pages) for contact emails, phone and social links, then assign a 0-100 lead score. Stack Exchange exposes the website & bio — this turns top contributors into contactable recruiting / dev-marketing leads.

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

Maximum number of primary records to output (questions in search/questions mode, answers in answers mode, users in users mode, tags in tags mode). Answer/comment enrichment rows are additional.

## `includeBodyMarkdown` (type: `boolean`):

Also include the original Markdown source (<code>bodyMarkdown</code>) of questions/answers alongside the rendered HTML and the clean plain-text body.

## `monitorMode` (type: `boolean`):

Remember item IDs across runs in a named key-value store and output ONLY items not seen before. Combine with an Apify Schedule (e.g. hourly/daily) for new-question or new-answer alerts on a tag, search or site. Works alongside Apify Schedules — it does not replace them.

## `monitorKey` (type: `string`):

Names the memory bucket for monitor mode. Use a distinct key per saved configuration (e.g. <code>so-python-new</code>) so separate monitors don't share state.

## `apiKey` (type: `string`):

Optional free key from <a href='https://stackapps.com/apps/oauth/register'>stackapps.com</a>. Not required — the actor works keyless — but a key raises the daily request quota from 300 to 10,000, useful for large or frequent runs.

## `accessToken` (type: `string`):

Optional OAuth access token (used together with the API key) for the highest quotas. Almost never needed for public data.

## `proxyConfiguration` (type: `object`):

Proxy settings. The default Apify proxy is recommended — the actor rotates a fresh IP per request to spread the Stack Exchange per-IP daily quota.

## Actor input object example

```json
{
  "mode": "search",
  "site": "stackoverflow",
  "searchQuery": "rust async",
  "sort": "votes",
  "order": "desc",
  "acceptedOnly": false,
  "includeAnswers": false,
  "includeComments": false,
  "includeUserTopTags": false,
  "includeTagDetails": false,
  "enrichUserContacts": false,
  "maxItems": 100,
  "includeBodyMarkdown": true,
  "monitorMode": false,
  "monitorKey": "default",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped Stack Exchange records (questions, answers, developer leads and tags) as JSON items in the default dataset.

# 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 = {
    "site": "stackoverflow",
    "searchQuery": "rust async",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapesage/stackexchange-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 = {
    "site": "stackoverflow",
    "searchQuery": "rust async",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapesage/stackexchange-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 '{
  "site": "stackoverflow",
  "searchQuery": "rust async",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call scrapesage/stackexchange-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapesage/stackexchange-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/iksSaIPRfvMgb4Hph/builds/zNsxSxocdElINJYW0/openapi.json
