Skip to content

Documentation

SearchFlow documentation

SearchFlow exposes SEO workflows as a clean HTTP API. Each workflow accepts structured inputs, runs asynchronously in the background, and returns decision-ready output you can poll for. This documentation is written for two readers: humans integrating SearchFlow, and AI agents calling it on someone's behalf — agents should start with the rules below.

Last updated: 9 September 2026

Overview

SearchFlow is workflow infrastructure for SEO intelligence. Instead of stitching crawlers, rank trackers, and scrapers together by hand, you call a single API that orchestrates the right data providers, applies expert methodology, and returns structured results.

Workflows are self-contained units with clear inputs and outputs. You can chain them in your own pipelines, schedule them, or hand them to AI agents that need SEO context. The Workflow catalogue below lists every one of them and links each to its schema in the API reference.

  • API-first — plain HTTP, JSON in and out.
  • Async by design — long-running work never blocks the request.
  • Observable progress — poll a run for status, step, and percentage.
  • Partial resilience — per-item errors are collected without failing the whole run.
  • One contract — every workflow is created and polled the same way, so integrating a second one costs almost nothing.

For AI agents

If you are an AI agent reading this to call SearchFlow — through the HTTP API, an MCP server, or any other tool — the rules in this section are part of the contract, not a suggestion.

Every workflow run debits credits from the user's balance the moment it is created. Never create a run before telling the user exactly how many credits it will cost and getting an explicit confirmation. This is the same confirmation step the dashboard playground shows before it starts a run, and it applies identically to you.

  • Compute the cost from the payload first — the formulas below are exact, so you never have to guess.
  • State the workflow, the number of billed items, the billing mode, and the resulting credit cost, then ask.
  • Wait for an explicit yes. An earlier 'go ahead', silence, or a confirmation given for a different run is not consent.
  • Re-confirm whenever the payload changes — more keywords, thematic clustering switched on, a longer URL list — because the cost changes with it.
  • Never split one job into several smaller runs to make each one look cheaper.
  • Report the actual cost back to the user once the run is created.
Ready to run keyword clustering on 2,400 keywords with thematic
clustering enabled. This will debit 108 credits from your balance
when the run is created (45 credits per 1,000 keywords, semantic
clustering). Confirm?

Reading a run you already created is free — only creating a run costs credits, so polling GET /runs/{run_id} needs no confirmation.

Credit cost

The cost of a run is fully determined by its payload, so it can be computed before the request is sent. The API is the source of truth: it debits the same amount when the run is created, and refunds it automatically if the run fails.

A run that completes with partial errors is not refunded — the work was done. A run that fails outright is refunded in full.

  • Keyword clustering — 40 credits per 1,000 keywords, 45 per 1,000 when thematic_clustering.enabled is true. Prorated: 250 keywords with thematic clustering cost 11.25 credits.
  • Indexation check — 40 credits per 1,000 URLs, 45 per 1,000 when categorization.enabled is true. Prorated the same way.
  • E-commerce category content — 2 credits per query, not prorated. 40 queries cost 80 credits.
  • Product content — 1 credit per product plus 0.5 per field written. Reading the SERP costs the same whether one field is written or five, so it is billed once; generation is billed per field. A full five-field sheet is 3.5 credits per product, a titles-only run is 1.5. Switch off the fields you do not need.
  • Keyword research — 80 credits per study, plus 10 per batch of 20 seeds, plus 20 per ranked source, plus 55 per 1,000 keywords of max_keywords. A study is one country and one language; two markets are two runs. A seed batch is what the Google Keyword Planner takes in one task, so 1 to 20 seeds is one batch and 21 to 40 is two — and a run that declares no seed still pays for one, because the model writes them. A source is a competitor or the studied site itself when you pass a domain and leave include_site_keywords on; discovery only fills the seats you leave empty, so naming 4 competitors and asking for 2 more still bills 4. So: a domain, 2 competitors, 20 seeds, max_keywords 2000 = 80 + 10 + 20x3 + 55x2 = 260 credits.
  • Rank or create — 2 credits per query and per market, not prorated. A site declared with one market bills 2 credits per query; a site declared with a French and a Dutch market bills 4, because every query is analysed once per market. 20 queries on a single-market site cost 40 credits.
  • Coverage gap analysis — 45 credits per 1,000 keyword slots, prorated. A slot is one keyword row the run may read, and the count is markets × (competitors + 1) × keywords_per_domain — the site's own domain is the +1. Named competitors replace discovery, so a run with 3 named competitors and keywords_per_domain 500 on one market is 4 × 500 = 2,000 slots = 90 credits. A discovery run is billed on competitor_discovery.limit, because what discovery will find is not knowable before the call.
  • Local SEO pages — 3 credits per city, not prorated. One city is one page. 20 cities cost 60 credits. The rate is flat: it covers the local pack, the Google Maps listing, the competitor extraction and the generation, and it does not change with the number of sections, FAQ entries or businesses requested.
  • Informational content — 4 credits per article plus 1 per 1,000 words of the length.max_words ceiling, rounded up. Omit the length block and the ceiling is 1,400 words, so an article costs 6 credits; set max_words to 1,000 or less and it costs 5. The detected article format never changes the price — only what you send does.
  • Technical crawl — 4 credits per run, plus 20 per 1,000 pages of crawl.max_pages, plus 0.2 per JavaScript-rendered page. The rendered sample is ceil(max_pages × javascript_rendering.percent / 100), capped at 200. A 1,000-page crawl with the default 5% sample is 4 + 20 + 10 = 34 credits.
  • Technical crawl bills the crawl BUDGET, not the pages found: crawl.max_pages is charged even if the site turns out to be smaller. Set it to what you actually want read. The same applies to the rendered sample in mode 'auto' — it is billed up front and skipped when no JavaScript framework is detected, so send mode 'off' if you know the site is server-rendered and want to pay nothing for it.
  • Discover topics — 4 credits per theme plus 0.6 per exploration keyword. Expanding the theme and analysing the coverage cost the same at any depth, so they are billed once per theme; the Google News reads follow exploration.keywords. The default of 10 keywords is 10 credits per theme; the range is 3 to 30, so 5.8 to 22 credits. exploration.topics does not change the price.
  • Discover article — a flat 5 credits per article, plus 9 more per article when image.generate is true. The image prompt is always returned and is never billed; the 9 credits buy the rendered 2048×1152 cover. Nothing else in the payload changes the price — length, articles_read and source_urls only ever lower the cost the flat rate was set on.
  • Cannibalization analysis — 1 credit per analysed query, 1.5 when recommendations.enabled is true (the default). One query is one SERP read for one market, so the same query submitted for two markets is two readings and costs two.
  • Internal linking analysis — 3 credits per run, plus 30 per 1,000 pages of analysis.max_pages, plus 0.12 per page when analysis.content_source is page_text. A 1,000-page analysis is 3 + 30 = 33 credits, or 153 with the page text bought from Exa. The crawl it reads costs nothing: it was paid for by the technical crawl that stored it, and stays reusable for 30 days.
  • Internal linking analysis bills the page BUDGET, not the pages the crawl holds: analysis.max_pages is charged even when the crawl turns out smaller. A budget smaller than the crawl still measures the whole link graph — PageRank, orphans, dead ends and anchors always cover every page — it only limits how many pages are compared semantically, and coverage.partial says so in the result. recommendations.max_links never changes the price.
  • Content decay — 0.3 credits per page of analysis.max_pages, plus 0.05 per SERP check of serp_verification.max_queries. Both are ceilings and both are billed in full whether or not the site holds that much: the defaults, 50 pages and 20 checks, cost 0.3x50 + 0.05x20 = 16 credits. Reading Search Console is free however large the site is, so the size of the site never changes the price — only these two numbers do. Set serp_verification.enabled to false and the second term is zero.
  • Indexation check, category content, product content, rank or create, local SEO pages and informational content and both Discover workflows and cannibalization analysis collapse duplicates before billing; keyword clustering does not, so every keyword you send is charged. De-duplicate the list yourself.
  • Keyword research is billed on max_keywords, not on what it returns. It is the ceiling on the merged sheet — the only list that gets one SERP read per keyword — so a run that finds fewer relevant keywords still costs what you asked for. Set it to the size of study you want. The two form helpers are billed separately and on delivery: POST /keyword-research/site-description costs 1 credit, POST /keyword-research/brand-variants costs 0.5, and a call that fails costs nothing.

If the balance is too low, the API answers 402 and nothing is queued and nothing is charged — but check the cost with the user before you get there, not after.

Quick start

Create an API key from the dashboard under Usage & billing, then call a workflow endpoint. Every workflow follows the same pattern: create a run, poll until the status is completed or failed, then read the result.

  • Generate an API key at /app/usage.
  • POST to the workflow runs endpoint with your payload.
  • Receive 202 Accepted with a run_id.
  • GET the run until status is completed or failed.
curl -X POST https://api.searchflow.app/api/v1/workflows/keyword-clustering/runs \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "keywords": [
      { "keyword": "agence seo", "volume": 1000 },
      { "keyword": "agence seo paris", "volume": 900 }
    ],
    "locale": { "country": "fr", "language": "fr" },
    "serp_similarity_threshold": 0.4,
    "thematic_clustering": { "enabled": true, "label_with_ai": true },
    "domain_tracking": { "enabled": false }
  }'

Authentication

Authenticate with a Bearer token using your SearchFlow API key. Keys are created in the dashboard and can be rotated at any time.

When a valid API key is provided, requests are attributed to your account and logged for usage tracking. Workflow runs created with a key are scoped to your user — other authenticated users cannot read them.

Authorization: Bearer sf_live_xxxxxxxx

The dashboard playground authenticates with your Supabase session (Bearer JWT). External integrations should use an API key (sf_live_…). MCP clients can use either that key or a token they obtain themselves through the connection flow described below — both resolve to the same account.

MCP server

SearchFlow is available as a hosted MCP server, so an AI assistant can run workflows directly. It is remote — nothing to install. Paste https://api.searchflow.app/mcp into any MCP client that supports remote servers and click Connect: the client registers itself, sends you to searchflow.app to sign in, shows you a consent screen naming what it will be able to do, and receives a token bound to your account. No key to create, no configuration file to edit.

Under the hood that is OAuth 2.1 with PKCE, hosted by the API itself, with dynamic client registration (RFC 7591) because an MCP client cannot be pre-registered. Discovery starts at the protected resource metadata the 401 points to; every endpoint it names is served from the API origin.

For a server-side integration with no browser in the loop, an API key still works and is the simpler option: send it as a bearer token and skip the OAuth flow entirely.

Six tools cover every workflow, because they all share one contract. The usual sequence is searchflow_list_workflows, then searchflow_get_workflow_schema for the one you want, then searchflow_estimate_cost on the payload you built, then searchflow_start_run. A workflow that reads Search Console takes the property to use as gsc_site_url: list them first and ask which one.

  • searchflow_list_workflows — every workflow your account can run.
  • searchflow_list_search_console_properties — the Search Console properties your connected Google accounts can read, to pick the one a run passes as gsc_site_url. Free.
  • searchflow_get_workflow_schema — the JSON Schema of one workflow's payload.
  • searchflow_estimate_cost — prices a payload and reports your balance. Charges nothing.
  • searchflow_start_run — creates the run. This debits credits.
  • searchflow_get_run — status, progress and result. Free, and safe to poll.
// One click: the client discovers OAuth and asks you to sign in.
{
  "mcpServers": {
    "searchflow": { "url": "https://api.searchflow.app/mcp" }
  }
}

// Or a key you paste yourself, for a server-side integration.
{
  "mcpServers": {
    "searchflow": {
      "url": "https://api.searchflow.app/mcp",
      "headers": { "Authorization": "Bearer sf_live_xxxxxxxx" }
    }
  }
}

A token issued through the connection flow can start billed runs, which is why the consent screen names the spend and why searchflow_start_run is annotated as destructive. searchflow_estimate_cost validates through the same request model the run uses, so the figure it returns is the cost of the run that will actually execute — duplicates already collapsed. Quote it to the user and get a yes before calling searchflow_start_run.

How workflows run

Workflows are designed for work that can take seconds to hours. A POST request validates your input, enqueues the job, and immediately returns 202 Accepted with a run_id.

Execution happens in background workers backed by a Redis queue. State is persisted in Supabase so you can poll reliably across restarts.

  • queued — accepted and waiting for a worker.
  • running — pipeline in progress; check progress and message fields.
  • completed — result is available on the run object.
  • failed — the workflow could not finish; see errors for details.

Progress and polling

Poll GET /api/v1/workflows/{workflow}/runs/{run_id} until status is completed or failed. A 2-second interval and a generous timeout are enough for anything: the short queue answers in minutes, and a large crawl runs for hours.

While running, the response carries progress (0–100), current_step, and a human-readable message such as 'Reading Search Console: 3 / 8 windows'.

  • status is the contract — queued, running, completed, failed — and it is the same for every workflow.
  • current_step is workflow-specific and there are dozens of values across the catalogue. Show it, do not branch on it.
  • message is written for a human. It is the field to put on screen.
  • progress is monotonic within a run but not a time estimate: a step that reads a provider can hold the same number for minutes.

Reading a run is free and never charged, however often you poll. Only creating one costs credits.

Workflow catalogue

Every workflow the API serves, with what it does, what a call cannot omit, and what a completed run holds. This is the overview: the full request schema, every optional block and a real response body live in the API reference, one link away from each entry.

All of them follow the same contract — POST to create a run, poll the GET until it settles — so learning one is learning all of them. The playground under /app/playground runs each of these from a form, pre-filled, with the credit cost shown before anything is spent.

Topical authority

  • Keyword clustering

    keyword-clustering

    Group keywords by SERP overlap, then optionally merge into labeled thematic clusters.

    Requires
    keywords
    Returns
    serp_clusters, semantic_clusters when thematic clustering is on, and the keywords that failed in errors.

    Duplicates are not collapsed here: every keyword you send is charged. De-duplicate the list yourself.

    Request and response schema

  • Keyword research

    keyword-research

    Build a full keyword study for one market: widen from the Keyword Planner and from competitors, filter the off-topic queries, cluster by SERP, and deliver a workbook.

    Requires
    business_description
    Returns
    seeds and where they came from, the competitors read, a taxonomy, SERP clusters, per-intent sheets and a flat export row per keyword.

    One study is one country and one language. Two markets are two runs.

    Request and response schema

Technical SEO

  • Indexation check

    indexation-check

    Check whether Google has indexed a list of pages, then optionally group them into labeled categories.

    Requires
    urls
    Returns
    one row per URL with its status and the URL Google actually matched, plus categories when categorization is on.

    The only workflow on the short queue — expect minutes, not hours.

    Request and response schema

  • Technical crawl

    technical-crawl

    Crawl a site, rank what actually costs it traffic, and check on a sample whether its pages survive without JavaScript.

    Requires
    site
    Returns
    a verdict, findings ranked by what they cost in traffic, quick_wins, the JavaScript-rendering sample and a crawl_snapshot other workflows read.

    A large crawl runs for hours. The run is resumable: a deployment mid-crawl picks the provider task back up rather than paying for it twice.

    Request and response schema

  • Internal linking analysis

    internal-linking-analysis

    Read a stored crawl as a graph and a set of subjects, then return the links to add: from which page, to which page, with which anchor, and why.

    Requires
    crawl
    Returns
    a verdict, priorities, the link graph, orphan and dead-end pages, anchor issues and the links to add.

    Reads a crawl a technical crawl already stored, and never crawls again. Run that workflow first.

    Request and response schema

E-commerce

  • Category content

    ecommerce-category-content

    Write the short intro and the long text of a category page from the live SERP.

    Requires
    queries
    Returns
    one item per query, holding the short intro and the long text.

    Request and response schema

  • Product content

    product-content

    Write the title, meta description, short and long descriptions and Google Shopping description of a product sheet.

    Requires
    products
    Returns
    one item per product, holding only the fields you asked for.

    Reading the SERP is billed once per product; generation is billed per field. Switch off the fields you do not need.

    Request and response schema

Content production

  • Local SEO pages

    local-seo-page

    Write one landing page per city from the live local pack: the businesses Google actually ranks there, the questions residents ask, and the sections that trade needs.

    Requires
    cities, service
    Returns
    one item per city, holding the page and its sections.

    Request and response schema

  • Informational content

    informational-content

    Read the format off the SERP (tutorial, guide, comparison, definition), then plan and write the article for it.

    Requires
    articles
    Returns
    one item per article, with the format detected from the SERP, the outline and the text.

    Request and response schema

  • Discover topics

    discover-topics

    Turn a theme into ranked Google Discover topics, read from what the Google News tab is publishing on it right now.

    Requires
    themes
    Returns
    one item per theme, holding the ranked topics and what is behind each.

    Request and response schema

  • Discover article

    discover-article

    Write a headline, standfirst and article aimed at the Google Discover feed, with a ready-to-use cover image prompt.

    Requires
    articles
    Returns
    one item per article: headline, standfirst, body, a cover prompt, and the rendered cover when image.generate is on.

    Request and response schema

Analysis

  • Rank or create

    rank-or-create

    For each query, compare the top 3 with the site's own best pages and decide whether to optimise one or write a new one.

    Requires
    queries, site
    Returns
    one item per query and per market with its verdict, plus priorities.

    Every query is analysed once per declared market, and billed once per market.

    Request and response schema

  • Coverage gap analysis

    coverage-gap-analysis

    Compare a site with its competitors keyword by keyword, filtered against what the business actually sells.

    Requires
    site
    Returns
    one block per market — themes with a status and a recommended action — plus a flat export row per keyword, discarded ones included.

    A domain whose market cannot be inferred — a .com, a .be — is refused with 422 rather than analysed against a guess.

    Request and response schema

  • Cannibalization analysis

    cannibalization-analysis

    Find the pages of one site (or of a group of sites) competing for the same queries, and say which one should win.

    Requires
    site, queries
    Returns
    groups of competing pages, each naming the page that should win.

    Request and response schema

  • Content decay

    content-decay

    Find the pages losing search traffic slowly rather than suddenly, and say whether to rewrite, relink, or let go.

    Requires
    site
    Returns
    the period compared, the eroding pages, the incidents behind them and what to do about each.

    Reads your own Search Console property. Connect one under Integrations first.

    Request and response schema

The exact credit formula for each of these is in the Credit cost section above, and the rate an agent must quote is the one the API charges — not an estimate.

Errors

SearchFlow distinguishes HTTP errors (bad request, not found, service unavailable) from workflow-level errors collected during execution.

Workflow errors are objects with a stage, a message, and the item they concern — keyword for the keyword workflows, item everywhere else. One failing item never fails the run: a run can complete with a full result and a non-empty errors array, and it is not refunded, because the rest of the work was done.

A run that fails outright is refunded in full. Read errors even on a completed run — it is where a keyword whose SERP could not be fetched, or a page an extractor could not read, is reported.

  • 401 — missing or invalid API key. Every workflow endpoint requires authentication.
  • 402 — insufficient credits for the requested run. Nothing is queued and nothing is charged.
  • 404 — run not found, or not accessible to the authenticated user.
  • 422 — request validation failed: a required field is missing, a list is empty, or a market could not be inferred from the domain you sent.
  • 503 — Supabase or Redis not configured on the API.

Base URL

Workflow endpoints are prefixed with /api/v1. The current public API base URL is https://api.searchflow.app. The OAuth endpoints behind the MCP connection sit at the root instead — /.well-known/oauth-protected-resource, /.well-known/oauth-authorization-server, /register, /authorize, /token and /revoke — because RFC 8414 and RFC 9728 place them on the issuer origin.

Set NEXT_PUBLIC_API_URL in your environment to match your deployment. The dashboard playground proxies requests through the web app to avoid CORS during browser testing.

When ENABLE_DOCS is enabled on the API, interactive OpenAPI documentation is available at /docs on the API host.