# Summarize API
> Summarize text and pull out its keywords — no AI key, no external model. The summarize endpoint is extractive: it scores every sentence by word frequency and position and returns the most representative ones (ask for a fixed number of sentences or a fraction of the original), keeping the author's exact wording and order. The keywords endpoint ranks the most salient terms with their counts and a relative score, filtering out stopwords. Because it is deterministic and runs locally, the same text always gives the same result, instantly and privately. Perfect for article previews and TL;DRs, search snippets, tagging and content triage, and feeding shorter context to downstream tools. Pure local computation — no third-party service; send long text via POST. Live, nothing stored. 3 endpoints. Distinct from sentiment/NLP analysis, stopword lists and Unicode text segmentation.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/summarize-api/..."
```

## Pricing
- **Free** (Free) — 780 calls/Mo, 2 req/s
- **Starter** ($1/Mo) — 6,300 calls/Mo, 8 req/s
- **Pro** ($19/Mo) — 126,000 calls/Mo, 20 req/s
- **Mega** ($55/Mo) — 650,000 calls/Mo, 50 req/s

## Endpoints

### Summarize

#### `GET /v1/keywords` — Extract keywords

**Parameters:**
- `text` (query, required, string) — Text to analyse Example: `Artificial intelligence is transforming industries worldwide. Machine learning models can now translate languages, recognize images and generate text. These AI systems learn from vast amounts of data. Companies invest heavily in artificial intelligence research. The future of AI promises even greater automation across the economy.`
- `limit` (query, optional, string) — How many (default 10) Example: `5`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/summarize-api/v1/keywords?text=Artificial+intelligence+is+transforming+industries+worldwide.+Machine+learning+models+can+now+translate+languages%2C+recognize+images+and+generate+text.+These+AI+systems+learn+from+vast+amounts+of+data.+Companies+invest+heavily+in+artificial+intelligence+research.+The+future+of+AI+promises+even+greater+automation+across+the+economy.&limit=5"
```

**Response:**
```json
{
    "data": {
        "keywords": [
            {
                "word": "ai",
                "count": 2,
                "score": 1
            },
            {
                "word": "artificial",
                "count": 2,
                "score": 1
            },
            {
                "word": "intelligence",
                "count": 2,
                "score": 1
            },
            {
                "word": "amounts",
                "count": 1,
                "score": 0.5
            },
            {
                "word": "automation",
                "count": 1,
                "score": 0.5
            }
        ]
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:50.253Z",
        "request_id": "ac3ac912-7f5d-4081-90b7-dbb952738572"
    },
    "status": "ok",
    "message": "Extract keywords",
    "success": true
}
```

#### `GET /v1/summarize` — Summarize text

**Parameters:**
- `text` (query, required, string) — Text to summarize Example: `Artificial intelligence is transforming industries worldwide. Machine learning models can now translate languages, recognize images and generate text. These AI systems learn from vast amounts of data. Companies invest heavily in artificial intelligence research. The future of AI promises even greater automation across the economy.`
- `sentences` (query, optional, string) — How many sentences (default 3) Example: `2`
- `ratio` (query, optional, string) — Or a fraction 0-1

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/summarize-api/v1/summarize?text=Artificial+intelligence+is+transforming+industries+worldwide.+Machine+learning+models+can+now+translate+languages%2C+recognize+images+and+generate+text.+These+AI+systems+learn+from+vast+amounts+of+data.+Companies+invest+heavily+in+artificial+intelligence+research.+The+future+of+AI+promises+even+greater+automation+across+the+economy.&sentences=2"
```

**Response:**
```json
{
    "data": {
        "summary": "Artificial intelligence is transforming industries worldwide. Companies invest heavily in artificial intelligence research.",
        "sentences": [
            "Artificial intelligence is transforming industries worldwide.",
            "Companies invest heavily in artificial intelligence research."
        ],
        "summary_sentence_count": 2,
        "original_sentence_count": 5
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:50.349Z",
        "request_id": "5d73812f-7d7c-4dd8-82e7-8fced3459d84"
    },
    "status": "ok",
    "message": "Summarize text",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/summarize-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "name": "Summarize API",
        "notes": "Extractive (it selects existing sentences, never rewrites). Stopword filtering is tuned for English. Send long text via POST. Nothing is stored.",
        "version": "v1",
        "endpoints": [
            {
                "path": "/v1/summarize",
                "params": {
                    "text": "the text (required)",
                    "ratio": "or a fraction 0-1",
                    "sentences": "how many (default 3)"
                },
                "returns": "summary + the chosen sentences"
            },
            {
                "path": "/v1/keywords",
                "params": {
                    "text": "the text (required)",
                    "limit": "how many (default 10)"
                },
                "returns": "ranked keywords with counts and scores"
            },
            {
                "path": "/v1/meta",
                "params": [],
                "returns": "this document"
            }
        ],
        "description": "Extractive text summarization and keyword extraction. Picks the most representative sentences (by word-frequency and position) and ranks the most salient keywords. Deterministic, pure local, no key."
    },
    "meta": {
        "timestamp": "2026-06-03T01:09:50.447Z",
        "request_id": "bda873a3-6297-4e06-899d-d62479376136"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/summarize-api
OpenAPI spec: https://www.oanor.com/api/summarize-api/openapi.json
