# Keyword Extractor: Extract Keywords & Keyphrases from Text (`data-done-right/keyword-extractor`) Actor

Keyword extractor for text and web pages: extract keywords and keyphrases with RAKE, YAKE-style or TF scoring. 7 languages, auto language detection, scores and counts per keyword. No API key, no AI.

- **URL**: https://apify.com/data-done-right/keyword-extractor.md
- **Developed by:** [Data Done Right](https://apify.com/data-done-right) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.40 / 1,000 text analyzeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Keyword Extractor: Extract Keywords & Keyphrases from Text

This **keyword extractor** pulls the most important **keywords and keyphrases** out of any text, web page or dataset field. Paste texts or page URLs, pick a method (YAKE-style, RAKE or TF n-grams), and get ranked keywords with a score and a count for every text. It runs on plain statistics, so there is no AI, no model, no API key, and the same text always gives the same result.

It works in **English, Spanish, French, German, Portuguese, Italian and Dutch** and detects the language of each text on its own.

### What can this keyword extractor do

- **Extract keywords from text.** One result row per text with `keywords: [{keyword, score, count}]`, best first.
- **Extract keywords from a URL.** The main article text is pulled out of the page (menus, footers and cookie boxes are dropped) and analysed. The page title is returned too.
- **Extract keywords from a dataset.** Point it at the output of another Actor and name the field that holds the text (reviews, descriptions, transcripts, articles).
- **Keyphrase extraction, not only single words.** Choose 1 to 6 words per keyword (default 1 to 3).
- **Three scoring methods plus a mix.** YAKE-style (single-document statistics: casing, position, frequency, context), RAKE (phrases between stopwords), TF n-grams (repeated words and phrases), or `combined`.
- **Control the output.** Top N, minimum score, lowercase or original spelling, light plural merging, extra stopwords of your own, and removal of keywords that are just part of a better one.
- **Safe at scale.** Up to 5,000 items per run. One bad URL or empty text never stops the run: it gets its own row with a clear `status` and `error`.

### How to extract keywords from text

1. Paste one or more texts into **Texts** (one entry per text).
2. Leave **Method** on YAKE-style and **Language** on auto, or change them.
3. Run it. Each text becomes one row in the dataset with its keywords.

### How to extract keywords from a URL

Add page links to **Web page URLs**. Pages must show their text without JavaScript (blogs, news, docs, product pages usually do). Pages that need a login, are blocked for bots, or build their text in the browser return `status: "failed"` with the reason.

### Input example

```json
{
  "texts": ["Keyword extraction is the automated process of finding the most important words and phrases in a text."],
  "urls": ["https://www.python.org/about/"],
  "method": "yake",
  "topN": 10,
  "language": "auto",
  "minNgram": 1,
  "maxNgram": 3
}
```

More examples:

- `{"method": "rake", "minNgram": 2, "maxNgram": 4}` : only multi-word keyphrases.
- `{"datasetId": "<dataset id>", "datasetField": "reviewText", "topN": 5}` : top 5 keywords for every review.
- `{"language": "de", "lemmatize": true, "extraStopwords": ["brand"]}` : force German, merge plurals, ban a word.

### Output

One dataset row per text or page:

```json
{
  "index": 1,
  "source": "Keyword extraction is the automated process of finding the most import…",
  "sourceType": "text",
  "language": "en",
  "languageDetected": true,
  "wordCount": 84,
  "method": "yake",
  "keywords": [
    {"keyword": "keyword extraction", "score": 1.0, "count": 3},
    {"keyword": "automated process", "score": 0.85, "count": 1},
    {"keyword": "important words", "score": 0.85, "count": 1}
  ],
  "status": "ok",
  "error": null,
  "note": null
}
```

`score` runs from 0 to 1 and the best keyword of a text is always 1.0, so scores are comparable inside a text, not between texts. `count` is how many times the keyword appears. `status` is `ok`, `no_keywords`, `skipped` or `failed`. A `SUMMARY` record in the key-value store lists totals.

### How much does it cost

Pay per event: **$0.003 per text or page analysed** ($3 per 1,000), event `text-analyzed`. Failed pages, empty texts, texts without keywords and skipped items are free. Use **Max items** to cap a run. Platform compute is tiny because there is no browser and no model.

### Limits (honest)

- This is statistical extraction, not understanding. It ranks words by how they are used, so verbs and adjectives can slip in ("reads", "unlike machine learning"). Raise **minNgram** to 2, add **extra stopwords**, or try another method to tune it.
- Seven languages only. Other languages are analysed with English stopwords and a note.
- Very short texts (a few words) give few or poor keywords. Set the language yourself for short texts.
- Light plural merging is a simple suffix rule, not a dictionary lemmatizer.
- Web pages: no JavaScript rendering, no login pages, private network addresses are refused. PDFs and Office files are not read here.

### FAQ

**Is this the same as an SEO keyword research tool?** No. It finds the keywords that are *in* your text. It does not report search volume or competition.

**Which method should I use?** Start with YAKE-style. Use RAKE for longer descriptive phrases, TF for long documents where repetition matters, and `combined` when you want a middle ground.

**Does it use AI or send my text anywhere?** No. Everything runs inside the Actor. Texts are not sent to any AI service. Only pages you list are downloaded.

**Why do I get fewer keywords than Top N?** The text may be short, or **minScore**, the word range or overlap removal filtered some out.

**Can I feed it scraper output?** Yes: pick the dataset and name the field. If a field value is only a link it is fetched as a page.

**Are results the same every run?** Yes. There is no randomness.

### Related tools

- **Google Autocomplete & Keyword Suggestions: 10 Search Engines** to find what people search for.
- **Extract Text from PDF: OCR, PDF to Text & Markdown** to turn PDFs into text, then run them through this extractor.
- **YouTube Transcript Downloader & Scraper** to get video transcripts you can pass in as a dataset.

# Actor input Schema

## `texts` (type: `array`):

One text per entry (a sentence, a paragraph or a whole article). Each text gets its own result row and its own keywords. Example: a product review or a blog post.

## `urls` (type: `array`):

Optional. Public web pages to read. The main article text is extracted first (menus and footers are removed), then analysed. Pages that need JavaScript to show their text are not supported. Example: https://en.wikipedia.org/wiki/Keyword_extraction

## `datasetId` (type: `string`):

Optional. Pick an Apify dataset (for example the output of a scraper) and the text in the field below is analysed for every item. Example: a dataset ID such as aBcD1234eFgH5678i.

## `datasetField` (type: `string`):

Field of each dataset item that holds the text (or a URL of a page). Dotted paths work. Example: description or reviews.0.text. Default: text.

## `method` (type: `string`):

How keywords are scored. All scores are scaled so the best keyword of a text is 1.0. YAKE-style suits single documents, RAKE favors longer phrases, TF favors repeated terms.

## `topN` (type: `integer`):

How many keywords to return for each text. Example: 10.

## `language` (type: `string`):

Language of the texts, which decides the stopword list. Auto detects it for each text by comparing common words. Pick one if your texts are very short.

## `minNgram` (type: `integer`):

Smallest number of words in a keyword. Use 2 to get only phrases. Example: 1.

## `maxNgram` (type: `integer`):

Largest number of words in a keyword. Example: 3 returns single words, two-word and three-word phrases.

## `minScore` (type: `number`):

Drop keywords scoring below this value (0 to 1, the best keyword of a text scores 1). Example: 0.2.

## `lowercase` (type: `boolean`):

Return keywords in lowercase. Turn off to keep the most common original spelling (for example product names with capitals).

## `lemmatize` (type: `boolean`):

Count simple plural forms together, for example keyword and keywords. A light suffix rule, not a full dictionary lemmatizer.

## `removeOverlaps` (type: `boolean`):

Skip a keyword that is only a part of a better keyword with the same count (for example drop 'extraction' when 'keyword extraction' already covers every mention).

## `extraStopwords` (type: `array`):

Optional. Words that must never be part of a keyword, for example your brand name or boilerplate words. Example: click, cookie.

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

Most texts and pages analysed in one run. Extra items are listed as skipped and are not charged. Caps your cost.

## `maxCharsPerText` (type: `integer`):

Longer texts are cut to this length before analysis. Default 200000 (about 30,000 words).

## `concurrency` (type: `integer`):

How many items are processed at the same time. Mostly matters for URLs.

## `timeoutSecs` (type: `integer`):

How long to wait for a web page before giving up on it.

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

Optional. Only used when you give page URLs and a site blocks the default Apify IP. Leave off for texts.

## Actor input object example

```json
{
  "texts": [
    "Keyword extraction is the automated process of finding the most important words and phrases in a text. A keyword extractor reads a document and returns the keywords and keyphrases that describe it best. Marketers use keyword extraction to analyse web pages, customer reviews and support tickets, and to improve search engine optimization. Unlike machine learning models, algorithms such as RAKE and YAKE work on a single document and need no training data. Good keyphrase extraction helps with content tagging, topic discovery and text summarization."
  ],
  "datasetField": "text",
  "method": "yake",
  "topN": 10,
  "language": "auto",
  "minNgram": 1,
  "maxNgram": 3,
  "minScore": 0,
  "lowercase": true,
  "lemmatize": false,
  "removeOverlaps": true,
  "maxItems": 100,
  "maxCharsPerText": 200000,
  "concurrency": 5,
  "timeoutSecs": 30
}
```

# Actor output Schema

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

All result items of this run (the default dataset), as JSON, CSV, Excel and more.

## `records` (type: `string`):

Key-value store records: the run summary, notes on any problems, and any files.

# 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 = {
    "texts": [
        "Keyword extraction is the automated process of finding the most important words and phrases in a text. A keyword extractor reads a document and returns the keywords and keyphrases that describe it best. Marketers use keyword extraction to analyse web pages, customer reviews and support tickets, and to improve search engine optimization. Unlike machine learning models, algorithms such as RAKE and YAKE work on a single document and need no training data. Good keyphrase extraction helps with content tagging, topic discovery and text summarization."
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("data-done-right/keyword-extractor").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 = { "texts": ["Keyword extraction is the automated process of finding the most important words and phrases in a text. A keyword extractor reads a document and returns the keywords and keyphrases that describe it best. Marketers use keyword extraction to analyse web pages, customer reviews and support tickets, and to improve search engine optimization. Unlike machine learning models, algorithms such as RAKE and YAKE work on a single document and need no training data. Good keyphrase extraction helps with content tagging, topic discovery and text summarization."] }

# Run the Actor and wait for it to finish
run = client.actor("data-done-right/keyword-extractor").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 '{
  "texts": [
    "Keyword extraction is the automated process of finding the most important words and phrases in a text. A keyword extractor reads a document and returns the keywords and keyphrases that describe it best. Marketers use keyword extraction to analyse web pages, customer reviews and support tickets, and to improve search engine optimization. Unlike machine learning models, algorithms such as RAKE and YAKE work on a single document and need no training data. Good keyphrase extraction helps with content tagging, topic discovery and text summarization."
  ]
}' |
apify call data-done-right/keyword-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data-done-right/keyword-extractor"
        }
    }
}
```

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/FaRAQfkeFQS2W9tF2/builds/kxm9Z1PQoDFSZP2kv/openapi.json
