GET
/
news
curl --request GET \
  --url https://chat-api.you.com/news \
  --header 'X-API-Key: <api-key>'
{
  "news": {
    "results": [
      {
        "url": "https://news.you.com",
        "title": "Breaking News about the World's Greatest Search Engine!",
        "description": "Search on YDC for the news",
        "type": "news",
        "age": "18 hours ago",
        "page_age": "2 days",
        "breaking": false,
        "page_fetched": "2023-10-12T23:00:00Z",
        "thumbnail": {
          "original": "https://reuters.com/news.jpg"
        },
        "meta_url": {
          "scheme": "https",
          "netloc": "reuters.com",
          "hostname": "www.reuters.com",
          "path": "› 2023  › 10  › 18  › politics  › inflation  › index.html"
        }
      }
    ]
  }
}

Before You Get Started

To register for usage of our News API, please reach out via email at api@you.com.

Authorizations

X-API-Key
string
header
required

Query Parameters

query
string
required

Search query used to retrieve relevant results from index

count
integer

Specifies the maximum number of web results to return. Range 1 ≤ num_web_results ≤ 20.

offset
integer

Indicates the offset for pagination. The offset is calculated in multiples of num_web_results. For example, if num_web_results = 5 and offset = 1, results 5–10 will be returned. Range 0 ≤ offset ≤ 9.

country
string

Country Code, one of ['AR', 'AU', 'AT', 'BE', 'BR', 'CA', 'CL', 'DK', 'FI', 'FR', 'DE', 'HK', 'IN', 'ID', 'IT', 'JP', 'KR', 'MY', 'MX', 'NL', 'NZ', 'NO', 'CN', 'PL', 'PT', 'PH', 'RU', 'SA', 'ZA', 'ES', 'SE', 'CH', 'TW', 'TR', 'GB', 'US'].

search_lang
string

Language codes, one of ['ar', 'eu', 'bn', 'bg', 'ca', 'Simplified', 'Traditional', 'hr', 'cs', 'da', 'nl', 'en', 'United', 'et', 'fi', 'fr', 'gl', 'de', 'gu', 'he', 'hi', 'hu', 'is', 'it', 'jp', 'kn', 'ko', 'lv', 'lt', 'ms', 'ml', 'mr', 'Bokmål', 'pl', 'Brazil', 'Portugal', 'pa', 'ro', 'ru', 'Cyrylic', 'sk', 'sl', 'es', 'sv', 'ta', 'te', 'th', 'tr', 'uk', 'vi'].

ui_lang
string

User interface language for the response, one of ['es-AR', 'en-AU', 'de-AT', 'nl-BE', 'fr-BE', 'pt-BR', 'en-CA', 'fr-CA', 'es-CL', 'da-DK', 'fi-FI', 'fr-FR', 'de-DE', 'SAR', 'en-IN', 'en-ID', 'it-IT', 'ja-JP', 'ko-KR', 'en-MY', 'es-MX', 'nl-NL', 'English', 'no-NO', 'of', 'pl-PL', 'the', 'ru-RU', 'English', 'es-ES', 'sv-SE', 'fr-CH', 'de-CH', 'Chinese', 'tr-TR', 'English', 'English', 'Spanish'].

safesearch
string

Configures the safesearch filter for content moderation. off - no filtering applied.moderate - moderate content filtering (default). strict - strict content filtering.

spellcheck
boolean

Determine whether the query requires spell-checking. default is true.

recency
enum<string>

Specify the desired recency for the requested articles.

Available options:
day,
week,
month,
year

Response

200 - application/json
A JSON object containing array of news results
news
object