Перейти к навигации

Why did my SEO API request return 400 bad_request for a URL, country, language, or filter?

Просмотр в формате Markdown

BeatAPI SEO endpoints validate every request strictly and return 400 bad_request (at $0 cost) instead of silently dropping invalid fields. Most 400 errors come from sending country/language to a global endpoint, pairing an unsupported language with a country, using SQL wildcards in contains, or misspelling a field name.

The four most common causes of 400 bad_request

  1. Sending country or language to a marketless tool:
    • Accept country and language: keyword-overview, keyword-ideas, keyword-difficulty, domain-overview, ranked-keywords, top-pages, competitors.
    • Reject country and language: backlink-summary, backlinks, domain-rating, domain-rating-history, site-traffic.
  2. Unsupported country or country–language pair:
    • Around 90 Google markets are covered (two-letter lowercase code such as us, gb, de, jp); China (cn) is not supported.
    • language must belong to that market (for example, es is valid in us, zh-TW in hk, while de in us returns 400 and lists the allowed languages in error.message).
  3. Wildcards in ranked-keywords.contains:
    • contains does case-insensitive substring matching up to 80 characters and rejects % and _. Pass plain text such as "cluster", not "%cluster%".
  4. Unknown or misspelled request fields:
    • Extra fields (such as max_results instead of limit, or url instead of domain) are rejected so you never get an answer to a different question than you asked.

How domains and URLs are normalized

You do not need to strip protocols manually for domain: passing a full URL such as https://www.redis.io/docs/cluster/ is automatically reduced to redis.io (removing the scheme, path, and leading www.). Check the echoed domain field in the response to confirm what was queried.

For full field tables, see the SEO API reference and BeatAPI SEO Data API.

Back to SEO questions.