APITube Help Center

How to Fix 400 Bad Request Errors

Read the validation message and correct the named parameter

Erick Horn

Written by Erick Horn

August 22, 2026

Updated October 16, 2026

How to fix 400 Bad Request errors

A 400 Bad Request usually means a parameter has an invalid value. Read errors[0].code and errors[0].message in the response. The message identifies what to change before you send the request again.

{
  "status": "not_ok",
  "request_id": "…",
  "errors": [
    {
      "status": 400,
      "code": "ER0171",
      "message": "Limit is out of range. Your plan allows up to 250 results per page."
    }
  ]
}

What are the most common 400 validation errors?

  • Invalid value: check the type and format, such as a number supplied as text.
  • Must be 0 or 1: flags such as is_duplicate and is_paywall use these digits, rather than true or false.
  • Length outside the allowed range: for example, title must contain 2–100 characters and language.code 1–2 characters.
  • Must be greater than or equal to 0: a numeric filter such as media.images.count.min cannot be negative.

Why do pagination parameters return 400?

  • ER0170: per_page is not a valid number.
  • ER0171: per_page exceeds your plan’s limit: 250 on Professional and Corporate, 200 on Basic, 50 on Starter or 10 on Free. The default is 100, or the plan limit if lower.
  • ER0172: page is not a valid number.
  • ER0173: Free is limited to the first five pages. Narrow the search or use a paid plan for more pages.

Use whole numbers for page and per_page.

Why does a name filter return 400 instead of empty results?

An unknown name can return an error before any articles are returned:

  • ER0204: author name not found.
  • ER0214: source domain not found.
  • ER0216: person name not found.
  • ER0220: organization name not found.

Check the spelling. For people and organizations, use /v1/suggest/entities?prefix=disney to find a recognized name and check its type. You can also search headline text with title.

Suggest endpoints require a non-empty prefix; a missing one returns ER0346. If the request succeeds but has no articles, see why a query returns no results.

Why does a headline search with old dates return 400?

ER0110 means the requested date window exceeds the 31-day limit for headline searches. It applies to title, title_starts_with, title_ends_with, title_pattern and Boolean query, on every plan.

Set both published_at.start and published_at.end within 31 days. A start date without an end date runs up to now, which can make the window too wide. To cover a longer period, request separate windows; see how to search news by title.

Filters such as category.id, entity.id and source.domain do not have this headline-search limit. With no dates, a headline search uses the last 31 days and returns an ER0366 warning in meta.warnings.

How should my code handle a 400?

Fix the reported cause before retrying. Log the HTTP status, code and message so the person building the query can see what failed. See the error-code guide for other statuses.

Common Questions

Does a 400 consume quota?

No. A request rejected for invalid parameters does not use your request quota.

Can one request produce several 400 errors?

The response uses an errors array, but usually reports the first failing parameter group. Fix it and send the request again. Another invalid parameter may then be reported.

The message names a parameter I did not send — why?

Compare your actual request with the parameter reference. Check parameter spelling and how your client encodes the values. Use the debugging guide to inspect what the API received.


Related Articles