# Search Stack Exchange API

> Full-text search over any Stack Exchange site (stackoverflow, superuser, askubuntu, etc.). Returns question id, title, tags, score, answer count, accepted-answer flag, asker, timestamps.

Category: [Developer Tools APIs](https://upapi.io/apis/developer-tools) · Last updated 2026-06-12

## What is the Stack Exchange API on upAPI?

The Stack Exchange API on upAPI searches questions across Stack Overflow and any other Stack Exchange site, returning titles, tags, scores and answer counts as JSON. No Stack Exchange key of your own is needed, only one upAPI key. The Free plan includes 1,000 weighted units a month.

## How to call it

- Endpoint: `POST https://api.upapi.io/stackexchange-search.get`, key in the `X-Api-Key` header, JSON body.
- Cost: 1 weighted unit per call.
- Timeout: 15 seconds.
- Cache: identical requests are served from cache for 60 seconds, unbilled.
- Try it without writing code: https://app.upapi.io/try/stackexchange-search.get

```bash
curl -X POST https://api.upapi.io/stackexchange-search.get \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{ "site": "stackoverflow", "sort": "relevance", "query": "typescript", "pageSize": 10 }'
```

## Request parameters

- `site` (string) — Stack Exchange site slug (stackoverflow, superuser, askubuntu, serverfault, etc.)
- `sort` (string)
- `query` (string, required) — Full-text search query
- `pageSize` (integer)

## Response fields

- `hits` (array, required)
- `hits[].link` (string, required)
- `hits[].tags` (array, required)
- `hits[].score` (integer, required)
- `hits[].title` (string, required)
- `hits[].askedBy` (string, required)
- `hits[].createdAt` (string, required)
- `hits[].viewCount` (integer, required)
- `hits[].isAnswered` (boolean, required)
- `hits[].questionId` (integer, required)
- `hits[].answerCount` (integer, required)
- `hits[].lastActivity` (string, required)
- `hits[].hasAcceptedAnswer` (boolean, required)
- `site` (string, required)
- `query` (string, required)
- `hasMore` (boolean, required)
- `fetchedAt` (string, required)
- `totalReturned` (integer, required)
- `quotaRemaining` (integer, required)

## Example request and response

The example response is generated from the published output schema: it shows the shape and field names, not values from a recorded call.

```json
{
  "site": "stackoverflow",
  "sort": "relevance",
  "query": "typescript",
  "pageSize": 10
}
```

```json
{
  "hits": [
    {
      "link": "example",
      "tags": [
        "example"
      ],
      "score": 1,
      "title": "Alan Turing",
      "askedBy": "example",
      "createdAt": "example",
      "viewCount": 1,
      "isAnswered": false,
      "questionId": 1,
      "answerCount": 1,
      "lastActivity": "example",
      "hasAcceptedAnswer": false
    }
  ],
  "site": "example",
  "query": "typescript",
  "hasMore": false,
  "fetchedAt": "example",
  "totalReturned": 1,
  "quotaRemaining": 1
}
```

## Frequently asked questions

### How much does the Search Stack Exchange API cost per call?

Each call spends 1 weighted unit of your plan's monthly quota. Full pricing is at https://upapi.io/pricing.

### How do I authenticate to the Search Stack Exchange API?

Send your key in the X-Api-Key header. A free guest key is available without creating an account.

### Are Search Stack Exchange API responses cached?

Yes — identical requests are served from cache for 60 seconds, and a cache hit is not billed.

## More Developer Tools APIs

- [Detect Website Tech Stack](https://upapi.io/apis/developer-tools/detect-tech-stack)
- [Search dev.to Articles](https://upapi.io/apis/developer-tools/devto-articles-search)
- [Search GitHub Discussions](https://upapi.io/apis/developer-tools/github-search-discussions)
- [Search GitHub Issues](https://upapi.io/apis/developer-tools/github-search-issues)
- [Search GitHub Repositories](https://upapi.io/apis/developer-tools/github-search-repos)
- [Search GitHub Users](https://upapi.io/apis/developer-tools/github-search-users)
- [Star or Unstar a GitHub Repository](https://upapi.io/apis/developer-tools/github-repo-star)
- [Check a GitHub Account's Health](https://upapi.io/apis/developer-tools/github-account-health)
