@x12i/seo-api-hub
v0.1.0
Published
903 SEO APIs (keyword research, technical audits, backlinks, content optimization) as one typed catalog, with an SDK, MCP server and CLI that run them through the Apify API
Maintainers
Readme
@x12i/seo-api-hub
903 SEO APIs (keyword research, SERP tracking, technical audits, backlinks, content optimization) in one typed, searchable catalog, with an SDK, an MCP server and a CLI that run them through the Apify API.
Every API in the catalog is an Apify Store actor. Browsing and searching the catalog works offline with no account. Running an API needs an Apify token and uses your Apify credits at the actor's own price.
| Category | Id | APIs |
|----------|----|-----:|
| Keyword Research | keyword-research | 287 |
| Technical Audits | technical-audits | 161 |
| Backlinks & Authority | backlinks-authority | 23 |
| Content Optimization | content-optimization | 28 |
| Other SEO Tools | other-seo-tools | 404 |
Install
npm install @x12i/seo-api-hubNode 20.3 or later. Set APIFY_TOKEN (from Apify console > Settings > Integrations) to run APIs.
SDK
import { SeoApiHub, searchApis, getApi, listCategories } from '@x12i/seo-api-hub';
// Catalog: offline, no token needed
listCategories();
const { total, items } = searchApis({ q: 'google serp', category: 'keyword-research', limit: 10 });
getApi('s-r~backlinks-checker'); // also accepts 's-r/backlinks-checker' or the Store URL
// Runs: need APIFY_TOKEN (or { token })
const hub = new SeoApiHub();
const schema = await hub.getInputSchema('s-r~backlinks-checker'); // what input the actor expects
const backlinks = await hub.run('s-r~backlinks-checker', { domain: 'example.com' }, { maxItems: 100, timeoutSecs: 120 });
// Jobs longer than the 280 s synchronous limit
const run = await hub.startRun('apidojo~google-search-scraper', { queries: ['seo api'] });
const done = await hub.getRun(run.id, { waitForFinishSecs: 60 });
if (done.status === 'SUCCEEDED') console.log(await hub.getRunItems(run.id, { limit: 500 }));SeoApiHub options:
| Option | Default | Meaning |
|--------|---------|---------|
| token | APIFY_TOKEN, then UPSTREAM_APIFY_KEY | Apify API token |
| allowlist | SEO_API_HUB_ALLOWLIST (comma-separated) | Only these API ids may run; empty means all 903 |
| fetch | global fetch | Custom fetch, for proxies or tests |
| baseUrl | https://api.apify.com | Apify API base URL |
Run options: maxItems, timeoutSecs (run: 1 to 280, default 120), maxChargeUsd (spending cap for pay-per-event actors), memoryMbytes, signal.
Errors
Every failure is a SeoApiHubError with a code:
| Code | When |
|------|------|
| not_found | The id is not in the catalog |
| not_allowed | The API is not in the allowlist |
| missing_token | A run was attempted without a token |
| invalid_input | Input is not a JSON object, or an option is out of range |
| limit_exceeded | Input is larger than 1 MB |
| timeout | The run or request took too long (Apify 408, or no answer in time) |
| upstream_error | Apify returned an error; status and details.type carry Apify's status and error type |
MCP server
Add it to any MCP client (Cursor, Claude Desktop, and others):
{
"mcpServers": {
"seo-api-hub": {
"command": "npx",
"args": ["-y", "@x12i/seo-api-hub", "mcp"],
"env": { "APIFY_TOKEN": "apify_api_..." }
}
}
}| Tool | What it does |
|------|--------------|
| seo_list_categories | Categories with counts, the catalog source, and whether runs are possible |
| seo_search_apis | Search by words and category |
| seo_describe_api | Catalog entry plus the actor's input JSON schema |
| seo_run_api | Run and wait for dataset items (up to 280 s) |
| seo_start_run | Start a longer run without waiting |
| seo_get_run | Run status, plus items once it has succeeded |
The catalog tools work without a token. To embed the server in your own process, use createSeoMcpServer({ hub }) from @x12i/seo-api-hub/mcp.
CLI
npx @x12i/seo-api-hub categories
npx @x12i/seo-api-hub search google serp --category keyword-research --limit 5
npx @x12i/seo-api-hub describe s-r~backlinks-checker --schema
npx @x12i/seo-api-hub run s-r~backlinks-checker --input '{"domain":"example.com"}' --max-items 50
npx @x12i/seo-api-hub start apidojo~google-search-scraper --input-file input.json
npx @x12i/seo-api-hub status <runId> --wait 60 --itemsOutput is JSON on stdout. Errors are JSON on stderr with exit code 1.
Raw catalog
The catalog ships as JSON and can be imported directly:
import catalog from '@x12i/seo-api-hub/catalog.json' with { type: 'json' };Each entry is { id, name, url, actor, category, categories, description }. id is owner~name in lower case, and actor is the same path in the Store's original case.
Updating the catalog
The catalog is generated from cporter202/seo-apis-that-rank-pages, pinned to one commit (recorded in catalog.source).
npm run import # regenerate from the pinned commit
npm run import -- --commit <sha> # move to a newer upstream commit
npm run catalog:check # fail if the committed catalog differs from its sourceThe importer keeps Apify actor rows only, strips affiliate parameters from the Store links, and fails if the per-category counts differ from the upstream META.json.
Development
npm install
npm test # vitest
npm run typecheck
npm run build # tsc -> dist/
npm run cli -- search backlinksCredits
The API list is curated by Chris Porter in seo-apis-that-rank-pages. The APIs are third-party Apify actors: check each actor's Store page for its pricing, terms and data-use rules before running it. This package is not affiliated with Apify or the actor authors.
License
MIT for the code in this package.
