Skip to the content

Check a search without running it

POST /v1/validate_search

Checks the body exactly as POST /v1/search would, and answers with the search as it would run: every default filled in, and from and to evaluated to instants, with now the time the request arrives. Nothing is searched. A search that would be refused is refused here in the same way (see Checking before you send).

Request

Body

What to search for, as a term expression (see Search terms). To search for a text literally, put a backslash before every " and \ in it and wrap it in double quotes. Optional: without it, a search finds every document that passes its filters, newest first (see Searching without a term). How long it may be depends on your organization's agreement. A term that does not parse is refused with 400, and each mistake's span marks where it is (see problem types).

Example: STI半导体 || semiconductor"R&D \"A\"\\B"Syntax: Term expressions

strategystring

How the term is matched and ranked. Required with term, and refused without one.

  • headline: the term must match the headline.
  • body: the term must match the headline or the body, and a match in the headline ranks higher.

Each text in the term is matched in one language. A text with a Chinese character in it is matched against the Chinese: zh.headline as the headline, the Chinese text as the body, including Chinese text that hidden says is left out. Any other text is matched against the English: en.title as the headline, en.summary as the body, since there is no English full text.

With both, relevance falls off with the distance of the chosen date (dateField) from to. Neither strategy changes significantly or is removed in /v1. New strategies may be added.

typeInlist of strings

Only documents of these kinds. Without it, all kinds.

levelInlist of strings

Only documents issued at these levels. Without it, all levels.

Only documents from these issuers. Without it, all issuers.

0 of 426 chosen
topicInlist of strings

Only documents on these topics. Without it, all topics.

The earliest instant of the chosen date (dateField) to include (inclusive). Defaults to now-7d. How far back it may reach depends on your organization's agreement, and whatever dateField says, a search never finds a document whose date lies before that.

Example: now-7d/d2026-09-032026-09-03T00:00:00+08:002026-09-03+Mnow[Europe/Berlin]-M/M2025-01-01[Asia/Shanghai]Syntax: Instant expressions

The instant of the chosen date (dateField) to stop before (exclusive). Defaults to now. It has to be later than from, whether either was sent or defaulted, or the request is refused with 400 (see Dates and time zones). How far ahead it may reach depends on your organization's agreement.

Example: now-7d/d2026-09-032026-09-03T00:00:00+08:002026-09-03+Mnow[Europe/Berlin]-M/M2025-01-01[Asia/Shanghai]Syntax: Instant expressions

dateFieldstringdefault date

Which of a document's dates from and to filter on and the time histogram counts. date is the one date each document is treated as having. The others are the members of dates, and each finds only documents that have that date. The ranking uses the chosen date too (see strategy and Searching without a term).

How many summaries each page of a search holds. With 0, a search returns hits and the histograms asked for, no summaries, and no next.

histogramsobject

The histograms to return with the first page, each named with its options: {"time": {}, "level": {}}. It names at least one; for none, leave it out. They cost more than the page itself, so ask only for those you use.

Responses

200 · Success

The search is valid, and this is how it would run now.

  • termstringmay be absent

    What to search for, as a term expression (see Search terms). To search for a text literally, put a backslash before every " and \ in it and wrap it in double quotes. Optional: without it, a search finds every document that passes its filters, newest first (see Searching without a term). How long it may be depends on your organization's agreement. A term that does not parse is refused with 400, and each mistake's span marks where it is (see problem types).

  • strategystringmay be absent

    How the term is matched and ranked. Required with term, and refused without one.

    • headline: the term must match the headline.
    • body: the term must match the headline or the body, and a match in the headline ranks higher.

    Each text in the term is matched in one language. A text with a Chinese character in it is matched against the Chinese: zh.headline as the headline, the Chinese text as the body, including Chinese text that hidden says is left out. Any other text is matched against the English: en.title as the headline, en.summary as the body, since there is no English full text.

    With both, relevance falls off with the distance of the chosen date (dateField) from to. Neither strategy changes significantly or is removed in /v1. New strategies may be added.

  • typeInlist of stringsmay be absent

    Only documents of these kinds. Without it, all kinds.

  • levelInlist of stringsmay be absent

    Only documents issued at these levels. Without it, all levels.

  • issuerInlist of stringsmay be absent

    Only documents from these issuers. Without it, all issuers.

  • topicInlist of stringsmay be absent

    Only documents on these topics. Without it, all topics.

  • fromstring

    The earliest instant of dateField the search would include.

  • tostring

    The instant of dateField the search would stop before.

  • dateFieldstring

    Which of a document's dates from and to filter on and the time histogram counts. date is the one date each document is treated as having. The others are the members of dates, and each finds only documents that have that date. The ranking uses the chosen date too (see strategy and Searching without a term).

  • pageSizeinteger, 0 to 100

    How many summaries each page of a search holds. With 0, a search returns hits and the histograms asked for, no summaries, and no next.

  • histogramsobjectmay be absent

    The histograms asked for, each with its options' defaults filled in, so "time": {} comes back as {"time": {"timeZone": "UTC"}}. Absent when none were asked for. A histogram may come to have options your client does not know yet, with their defaults.

Errors

Every error is a problem document with the fields below. Its type names the problem, and is the address of the problem's page.

400invalid-request

The request is not valid (invalid-request): a path that cannot be read, a body that is not JSON or does not match the schema, an unknown field, a from or to that is not a valid instant expression (an unknown time zone, or a time of day the zone skips, included), a from that is not earlier than to, a term that does not parse or is longer than your organization's agreement allows, an unknown issuer, a scope in the body that does not exist, or a saved search's name that breaks the naming rule. errors names each offending part: a pointer into the body (for the run of a saved search, into parameters as it ran), or the parameter of the path (see problem types).

401unauthenticated

No access token, or one that is invalid or has expired (unauthenticated). Refresh the access token and try again.

403no-organizationmultiple-organizationsorganization-not-registerednot-entitledaccess-endedtier-served-elsewhererange-not-entitledsuspended

The account may not do this. type says why: a refusal every operation can meet (no-organization, multiple-organizations, organization-not-registered, not-entitled, access-ended, tier-served-elsewhere or suspended, see Problem types), or the search reaches further than the organization's agreement allows (range-not-entitled, with the earliest allowed from in earliestFrom, the latest allowed to in latestTo, and an errors entry pointing at each end at fault).

413payload-too-large

The request body is too large (payload-too-large).

415unsupported-media-type

The request body is not application/json (unsupported-media-type).

429rate-limited

Too many requests, or too many at the same time (rate-limited), from your account, your organization, or your network address. Wait for Retry-After seconds, then send the same request again.

  • Header Retry-After

    How many seconds to wait before sending the same request again.

431headers-too-large

The request's headers are too large (headers-too-large). An access token is far below the limit, so look for a header your client adds.

503unavailable

The API is temporarily unavailable (unavailable), because our servers are under pressure or briefly out of service. Wait for Retry-After seconds, then send the same request again.

  • Header Retry-After

    How many seconds to wait before sending the same request again.

Any otherinternal

Any other error, as a problem document. Includes internal (500), a failure on our side.

A problem document's fields

  • typestring

    Identifies the problem; branch on this. One of the problem types under https://api.reconnectchina.org/docs/v1/problems/, named in each response's description and its x-problem-types, and listed in Problem types, for example https://api.reconnectchina.org/docs/v1/problems/continuation-expired. The URL is also the type's documentation.

  • titlestring

    A short, human-readable summary of the problem type.

  • statusinteger

    The HTTP status code.

  • detailstringmay be absent

    A human-readable explanation of this occurrence.

  • errorslist of objectsmay be absent

    For invalid-request, each part of the request that is not valid, and for range-not-entitled, each end of the range that reaches too far. Each names the part in exactly one way: pointer for a part of the body, parameter for a part of the path. A part with several mistakes in it, such as a term, has an entry for each, and span says where in it each one is.

  • parameterstringmay be absent

    The name of the path parameter, as this document names it, for example name in /v1/saved_searches/{scope}/{name}.

  • pointerstringmay be absent

    A JSON Pointer (RFC 6901  on another website) into the request body, for example /levelIn/0. Empty for the body as a whole. For the run of a saved search, it points into the search as it ran, as if the body had been {"parameters": …} with the saved parameters and your overrides: /parameters/from whether from was saved or sent.

  • spanobjectmay be absent

    Where in a string a problem is: the characters from start up to, not including, end, counting from 0. Characters are Unicode code points, as maxLength counts them, so 低空经济 is four; a program that marks text in another unit converts, such as a browser, whose strings count a character outside the Basic Multilingual Plane as two. Equal start and end mark the place where something is missing, such as the end of a term that stops after &&.

  • startinteger, at least 0
  • endinteger, at least 0
  • detailstring
  • earliestFromstring, up to 128 charactersmay be absent

    For range-not-entitled, the earliest from your organization may use, as an instant expression such as now-1y or 1900-01-01.

  • latestTostring, up to 128 charactersmay be absent

    For range-not-entitled, the latest to your organization may use, as an instant expression such as 3000-01-01.

  • serverstringmay be absent

    For tier-served-elsewhere, the server of this API that your account may use, one of servers, such as https://sandbox.api.reconnectchina.org.

Language
from reconnectchina import SearchParameters

parameters = SearchParameters()
effective = client.validate_search(parameters)
curl -X POST 'https://api.reconnectchina.org/v1/validate_search' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' \
  --data-raw '{}'
const effective = await client.validateSearch({});

client is logged in as on Logging in, or made from a saved token.

to api.reconnectchina.org

Example response · 200 · Sent on 2026-10-03

{
"term": "低空经济 || \"low-altitude economy\""
"strategy": "body"
"typeIn": [
"law/decree"
"regulation"
"notice/announcement"
"opinion/plan"
]
"from": "2026-08-31T22:00:00Z"
"to": "2026-09-30T22:00:00Z"
"dateField": "date"
"time": {
"timeZone": "Europe/Berlin"
}
}
}