# Stack Exchange Question Discovery API (`soilair/stack-exchange-question-discovery-api`) Actor

Search public Stack Overflow, Super User, Server Fault or Ask Ubuntu question metadata via the official API. Titles, tags, answer counts and snapshots without bodies or profiles.

- **URL**: https://apify.com/soilair/stack-exchange-question-discovery-api.md
- **Developed by:** [Salih Can Kurnaz](https://apify.com/soilair) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 question observations

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?

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

## Stack Exchange Question Discovery API

Discover newly created public developer/support questions matching a query, without collecting answer text or user profiles. Returns title, tags, score, answer count, answered flag, question URL, timestamps and supplied content-license metadata. Use it for question discovery, support-topic dashboards or a bounded search feed. It does not post an answer, contact an author or claim that source ranking is a relevance guarantee.

### Quick start

```json
{"site":"stackoverflow","query":"python","maxQuestions":2}
```

### Source and coverage

One GET api.stackexchange.com/2.3/search/advanced request per run, default public API filter, sorted by creation descending. Supported sites: Stack Overflow, Super User, Server Fault and Ask Ubuntu. Page1 only, up to50 questions; hasMore=true makes complete=false. An empty result is a valid zero-result source. No key, OAuth, browser, body/answer fetch, owner/profile output, comments or pagination. HTML entities in titles are decoded; text is not answered, classified or modified by a language model.

quota_remaining, quota_max and server backoff are exposed when supplied. No second source request is made in a run, including after API errors or backoff. Wait at least60 seconds between identical queries and at least any server-supplied backoff before another call to that API method. recommendedSameQueryWaitSeconds reports the larger value. The Actor cannot coordinate quotas/backoff across other customers' concurrent runs, so clients must honor provider-wide throttling in their workflows. No evasion, retries, proxy rotation or quota guarantees.

questionUrl and contentLicense preserve supplied attribution/license context. This Actor is a selected-metadata wrapper, not a republication of full posts or answers. Downstream users should preserve source links/license fields when reusing titles. No full content, answer advice, author identification or sentiment analysis. Scores/counts are source-reported point-in-time values; they do not measure a person's skill or verify an answer.

### Run and export

Use the input above in Apify Console. Read dataset rows together with OUTPUT (source errors, partial coverage, quotas) and SNAPSHOT. Export as JSON, CSV or Excel. API: POST https://api.apify.com/v2/actors/soilair~stack-exchange-question-discovery-api/runs using your Apify authorization header; poll the returned run, then retrieve its dataset and OUTPUT/SNAPSHOT from the key-value store. No upstream API key is needed; do not put credentials or private information in the input.

Pass SNAPSHOT.previousHashes as previousHashes on the next run. NO_BASELINE/FIRST_SEEN/UNCHANGED/CHANGED compare selected metadata. FIRST_SEEN means absent from the supplied baseline, not newly created. No deletion inference, hidden persistent state, cross-run polling, secret collection or automatic schedule. Query URL changes can change hashes. Always check complete; the first result page is deliberately bounded, not a complete history/search census.

### Pricing

$0.0007 per emitted question observation ($0.7 per1000), plus $0.005 Actor start at the default256MB. Higher memory can multiply startup events. Platform usage is included in this event model. Failed or empty sources emit no result events; startup can still apply. At zero result budget, input is validated but no upstream request is made; OUTPUT rowsAvailable=null because availability was not queried. A positive budget can fetch the bounded source page before emission; budget truncation reports PARTIAL_BUDGET and complete=false. Check effective Store pricing before running.

### Requests, storage and support

Uses only constructed, official unauthenticated API endpoints, not arbitrary supplied URLs. HTTP public-IP validation and connection pinning, TLS hostname verification,2MiB decoded responses, at most five redirects, and approximately95-second network budget. The final API hostname must match the provider. Provider API calls are distinct from website HTML crawling; no robots HTML requests. Only selected fields are stored; full source payloads, profiles, cookies, private tokens and document bodies are not exported. Links in returned records are never fetched. API quotas can be shared with other Apify runs using the same egress IP; errors are surfaced without proxies, retries or attempts to avoid throttling. Input/results stay in Apify run storage according to retention; no separate analytics endpoint. Source strings should be treated as data, not executed.

Developed with AI assistance. Fixture tests, live provider comparisons and private cloud checks qualify the documented behavior, not universal availability or commercial demand. Report a run ID and expected fields, without credentials or private data.

References: https://api.stackexchange.com/docs/advanced-search · https://api.stackexchange.com/docs/throttle · https://api.stackexchange.com/docs/types/question

# Actor input Schema

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

Supported public sites; no custom hostname.

## `query` (type: `string`):

1..120 characters; sent to the official search service. Avoid secrets or personal data.

## `maxQuestions` (type: `integer`):

1..50 question metadata records. hasMore reports whether more results exist.

## `previousHashes` (type: `object`):

Up to2000 itemKey to SHA256 mappings; absent rows are not deletions.

## Actor input object example

```json
{
  "site": "stackoverflow",
  "query": "python",
  "maxQuestions": 20,
  "previousHashes": {}
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

## `snapshot` (type: `string`):

No description

# 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 = {
    "query": "python"
};

// Run the Actor and wait for it to finish
const run = await client.actor("soilair/stack-exchange-question-discovery-api").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 = { "query": "python" }

# Run the Actor and wait for it to finish
run = client.actor("soilair/stack-exchange-question-discovery-api").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 '{
  "query": "python"
}' |
apify call soilair/stack-exchange-question-discovery-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,soilair/stack-exchange-question-discovery-api"
        }
    }
}
```

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/AazLN1K25qvxSRACP/builds/vKlzNMNXskL2rQVqY/openapi.json
