Skip to main content
POST
/
catchAll
/
validate
Validate query
curl --request POST \
  --url https://catchall.newscatcherapi.com/catchAll/validate \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "query": "Series B funding rounds for SaaS startups"
}
'
import requests

url = "https://catchall.newscatcherapi.com/catchAll/validate"

payload = { "query": "Series B funding rounds for SaaS startups" }
headers = {
    "x-api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({query: 'Series B funding rounds for SaaS startups'})
};

fetch('https://catchall.newscatcherapi.com/catchAll/validate', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://catchall.newscatcherapi.com/catchAll/validate",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'query' => 'Series B funding rounds for SaaS startups'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "x-api-key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://catchall.newscatcherapi.com/catchAll/validate"

	payload := strings.NewReader("{\n  \"query\": \"Series B funding rounds for SaaS startups\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://catchall.newscatcherapi.com/catchAll/validate")
  .header("x-api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"query\": \"Series B funding rounds for SaaS startups\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://catchall.newscatcherapi.com/catchAll/validate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"query\": \"Series B funding rounds for SaaS startups\"\n}"

response = http.request(request)
puts response.read_body
{
  "status": "good",
  "title": "Specific event type clear",
  "description": "Clear event type and focus; no timeframe needed for a default recent search.",
  "issues": [],
  "suggestions": [],
  "confidence": 0.98
}
{
  "detail": "Invalid API key"
}
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

x-api-key
string
header
required

API key for authentication.

Body

application/json
query
string
required

Plain text query to validate.

Example:

"Series B funding rounds for SaaS startups"

Response

Query validation result.

Query quality assessment returned by the validate endpoint.

status
enum<string>
required

Overall quality level of the query.

Available options:
good,
needs_work,
critical
title
string
required

Short headline summarising the assessment.

Example:

"Specific event type clear"

confidence
number
required

Confidence score for this assessment.

Required range: 0 <= x <= 1
Example:

0.98

description
string

Plain-language explanation of the assessment result.

Example:

"Clear event type and focus; no timeframe needed for a default recent search."

issues
enum<string>[]

Issues identified in the query. Empty when status is good.

Category of a query issue identified during validation.

  • missing_event_type: Query does not specify a type of event to find.
  • too_vague: Query lacks sufficient focus to return targeted results.
  • too_specific: Query is overly constrained and may return no results.
  • wrong_timeframe: Requested timeframe exceeds the 30-day maximum window or references a historical period outside the supported range.
  • static_content: Query targets static or reference content such as specifications, how-to guides, or historical data rather than events.
  • article_request: Query requests articles or news content rather than describing an event to search for.
  • multiple_event_types: Query mixes unrelated event types; results may be unfocused.
  • too_short: Query is too short to resolve meaningful search intent.
  • too_long: Query is excessively long and may confuse the pipeline.
Available options:
missing_event_type,
too_vague,
too_specific,
wrong_timeframe,
static_content,
article_request,
multiple_event_types,
too_short,
too_long
Example:
[]
suggestions
object[]

Actionable recommendations for each identified issue. Empty when status is good. Each suggestion corresponds to one entry in issues.

Example:
[]