# Stack Exchange — Questions Search (Stack Overflow & more) (`omao/stackexchange`) Actor

Search questions across Stack Overflow and any Stack Exchange site into clean JSON: title, score, views, answers, tags, owner, dates and link. Powered by the official Stack Exchange API. No API key, no anti-bot.

- **URL**: https://apify.com/omao/stackexchange.md
- **Developed by:** [Marouane Oulabass](https://apify.com/omao) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 questions

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/platform/actors/running/actors-in-store#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 Exchange — Questions Search (Stack Overflow & more)

**Search questions across Stack Overflow and any Stack Exchange site — as clean JSON.** Pass keywords and/or tags and get back a tidy row per question: title, score, views, answers, tags, owner, dates and link. Powered by the official Stack Exchange API — no API key, no anti-bot.

The easy way to mine developer Q\&A for research, monitoring and AI datasets.

### Who uses this

- 🧑‍💻 **Developers & DevRel** — track questions about your library, framework or product.
- 🤖 **AI / LLM & RAG pipelines** — build Q\&A datasets for training and retrieval.
- 📊 **Researchers & analysts** — study tech trends, tags and community activity.
- 🛠️ **Support & docs teams** — surface common problems users hit.
- 📈 **Product teams** — monitor pain points and feature requests in the wild.

### What you get — one clean row per question

| Field | Description |
|---|---|
| `title` | Question title |
| `score` | Net votes |
| `viewCount` | Views |
| `answerCount` | Number of answers |
| `isAnswered` + `hasAcceptedAnswer` | Answer status |
| `tags` | Question tags |
| `owner` + `ownerReputation` | Asker |
| `createdAt` + `lastActivityAt` | Dates |
| `link` | Link to the question |
| `site`, `query`, `scrapedAt` | Provenance |

### Example

**Input**

```json
{ "queries": ["pandas dataframe merge"], "tags": ["python", "pandas"], "site": "stackoverflow", "sort": "votes", "maxResultsPerQuery": 50 }
```

**Output (one item)**

```json
{
  "questionId": 53645882,
  "title": "How to merge two pandas DataFrames on multiple columns",
  "score": 214, "viewCount": 480000,
  "answerCount": 6, "hasAcceptedAnswer": true,
  "tags": ["python", "pandas", "dataframe", "merge"],
  "link": "https://stackoverflow.com/questions/53645882"
}
```

### Why this actor

- ✅ **Official source** — the Stack Exchange API, always current.
- 🌐 **Any Stack Exchange site** — Stack Overflow, Super User, Ask Ubuntu and more.
- 🏷️ **Search by keyword and tag** — combine both for precision.
- 🔽 **Sort options** — by votes, activity, creation or relevance.
- ⚡ **Fast & affordable** — pay only per question returned. No key, no anti-bot.

### Input options

- `queries` — keyword searches.
- `tags` — filter by tags.
- `site` — Stack Exchange site (default `stackoverflow`).
- `sort` — `votes`, `activity`, `creation` or `relevance`.
- `maxResultsPerQuery` — cap questions per query.

### FAQ

**Only Stack Overflow?** No — set `site` to any Stack Exchange site (e.g. `superuser`, `askubuntu`, `serverfault`).

**Can I filter by tag?** Yes — pass `tags` to narrow results.

**Do I get answers too?** You get answer counts and status; this actor focuses on questions.

**How fresh is the data?** Live from the Stack Exchange API on every run.

**Can I export to CSV/Excel/Google Sheets?** Yes — the dataset exports to JSON, CSV, Excel and HTML, or pull it via the API.

**What does it cost?** Pay-per-question — you're only charged for questions actually returned.

***

*Tip: monitor your product's tag weekly and diff new `questionId`s to catch fresh user problems.*

# Actor input Schema

## `queries` (type: `array`):

Free-text question searches. One search per query.

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

Restrict to questions with these tags (e.g. python, javascript).

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

Stack Exchange site (e.g. stackoverflow, superuser, serverfault, math).

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

Ordering of results.

## `maxResultsPerQuery` (type: `integer`):

Cap the number of questions returned per query.

## `healthCheckMode` (type: `boolean`):

Internal monitoring: run a canary search and FAIL if broken (no billing).

## Actor input object example

```json
{
  "queries": [
    "async await",
    "docker compose"
  ],
  "tags": [
    "python",
    "pandas"
  ],
  "site": "stackoverflow",
  "sort": "votes",
  "maxResultsPerQuery": 50,
  "healthCheckMode": false
}
```

# Actor output Schema

## `questions` (type: `string`):

All questions (title, score, answers, views, tags, owner, link).

# 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 = {
    "queries": [
        "pandas dataframe"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("omao/stackexchange").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 = { "queries": ["pandas dataframe"] }

# Run the Actor and wait for it to finish
run = client.actor("omao/stackexchange").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "queries": [
    "pandas dataframe"
  ]
}' |
apify call omao/stackexchange --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=omao/stackexchange",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/9dm9oBR0UyGspkae2/builds/aLbN9XR9CQSNzAZ2l/openapi.json
