qstring
Parameter defines the query you want to search. You can use anything that you would use in a regular Google News search. e.g. `site:`, `when:`. Parameter can't be used together with any of the `Advanced parameters`.
https://api.sandbase.ai/v1/api/google/newsSearch Google News by keyword, topic or publication and get headlines with source, date, thumbnail and story clusters, localized by country and language.
Sua saída aparecerá aqui
Preencha as entradas e clique em Executar.
Search Google News by keyword, topic or publication and get headlines with source, date, thumbnail and story clusters, localized by country and language.
curl -X POST "https://api.sandbase.ai/v1/api/google/news" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"q": "artificial intelligence"}'
The result is returned in outputs[0].data as structured JSON.
| Name | Type | Required | Description |
|---|---|---|---|
q | string | No | Parameter defines the query you want to search. You can use anything that you would use in a regular Google News search. e.g. site:, when:. Parameter can't be used together with any of the Advanced parameters. |
gl | string | No | Parameter defines the country to use for the Google News search. It's a two-letter country code. (e.g., us for the United States (default), uk for United Kingdom, or fr for France). Head to the Google countries page for a full list of |
hl | string | No | Parameter defines the language to use for the Google News search. It's a two or three-letter language code. (e.g., en for English, es for Spanish, or fr for French), optionally followed by a two-letter or three-digit region code (e.g. |
topic_token | string | No | Parameter defines the Google News topic token. It is used for accessing the news results for a specific topic (e.g., "World", "Business", "Technology"). The token can be found in our JSON response or the URL of the Google News page (in the |
kgmid | string | No | Parameter defines the Knowledge Graph ID (KGMID) of a topic or location for Google News results. It is a string that starts with /m/ or /g/. You can look up entities on Wikidata and use their "Freebase ID" as the kgmid. For example, ` |
publication_token | string | No | Parameter defines the Google News publication token. It is used for accessing the news results from a specific publisher (e.g., "CNN", "BBC", "The Guardian"). The token can be found in our JSON response or the URL of the Google News page (i |
section_token | string | No | Parameter defines the Google News section token. It is used for accessing the sub-section of a specific topic. (e.g., "Business -> Economy"). The token can be found in our JSON response or the URL of the Google News page (in the URL, it is |
story_token | string | No | Parameter defines the Google News story token. It is used for accessing the news results with full coverage of a specific story. The token can be found in our JSON response or the URL of the Google News page (in the URL, it is a string of c |
so | string | No | Parameter defines the sorting method. Results can be sorted by relevance or by date. By default, the results are sorted by relevance. List of supported values are: 0 - Relevance 1 - Date Parameter can be used together with story_token |
json_restrictor | string | No | Parameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details. |
$0.010 per successful call. Failed calls are not charged.
Comece a construir
Endpoint da API da plataforma com autenticação unificada e rastreamento de uso.
curl -X POST "https://api.sandbase.ai/v1/api/google/news" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "artificial intelligence"
}'Defina sua chave da API SandBase no ambiente do seu servidor. As requisições usam autenticação Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Mantenha sua chave no servidor. Não a exponha em código do navegador.
qstringParameter defines the query you want to search. You can use anything that you would use in a regular Google News search. e.g. `site:`, `when:`. Parameter can't be used together with any of the `Advanced parameters`.
glstringParameter defines the country to use for the Google News search. It's a two-letter country code. (e.g., `us` for the United States (default), `uk` for United Kingdom, or `fr` for France). Head to the Google countries page for a full list of supported Google News countries.
hlstringParameter defines the language to use for the Google News search. It's a two or three-letter language code. (e.g., `en` for English, `es` for Spanish, or `fr` for French), optionally followed by a two-letter or three-digit region code (e.g., `en-gb` for British English, or `es-419` for Latin American Spanish). Head to the Google languages page for a full list of supported Google languages.
topic_tokenstringParameter defines the Google News topic token. It is used for accessing the news results for a specific topic (e.g., "World", "Business", "Technology"). The token can be found in our JSON response or the URL of the Google News page (in the URL, it is a string of characters preceded by `/topics/`). Parameter can be used together with `section_token`.
kgmidstringParameter defines the Knowledge Graph ID (`KGMID`) of a topic or location for Google News results. It is a string that starts with `/m/` or `/g/`. You can look up entities on Wikidata and use their "Freebase ID" as the kgmid. For example, `/m/0vzm` is the kgmid for Austin, TX, and `/m/02mjmr` is the kgmid for Barack Obama. Parameter can only be used alone.
publication_tokenstringParameter defines the Google News publication token. It is used for accessing the news results from a specific publisher (e.g., "CNN", "BBC", "The Guardian"). The token can be found in our JSON response or the URL of the Google News page (in the URL, it is a string of characters preceded by `/publications/`). Parameter can be used together with `section_token`.
section_tokenstringParameter defines the Google News section token. It is used for accessing the sub-section of a specific topic. (e.g., "Business -> Economy"). The token can be found in our JSON response or the URL of the Google News page (in the URL, it is a string of characters preceded by `/sections/`) Parameter can be used together with `topic_token`, `publication_token`, and `so`.
story_tokenstringParameter defines the Google News story token. It is used for accessing the news results with full coverage of a specific story. The token can be found in our JSON response or the URL of the Google News page (in the URL, it is a string of characters preceded by `/stories/`) Parameter can be used together with `so`.
sostringParameter defines the sorting method. Results can be sorted by relevance or by date. By default, the results are sorted by relevance. List of supported values are: `0` - Relevance `1` - Date Parameter can be used together with `story_token` and `section_token`.
json_restrictorstringParameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.
Resposta de exemplo salva para esta API; nenhuma requisição ao vivo é feita ao visualizá-la.
Nenhuma resposta salva foi publicada. Execute a API no Playground para inspecionar a resposta.
Explorar mais
| API | Preço | Resposta |
|---|---|---|
Google NewsEsta API Google | $0.01 por chamada | JSON |
Google | $0.01 por chamada | JSON |
Google | $0.015 por chamada | JSON |
Google | A partir de $0.002 por chamada | JSON |
Google | A partir de $0.0015 por chamada | JSON |
Google | $0.01 por chamada | JSON |
Perguntas
Envie uma solicitação POST para https://api.sandbase.ai/v1/api/google/news com sua chave de API da SandBase no cabeçalho Authorization (Bearer) e os parâmetros no corpo JSON. Você também pode testar no Playground desta página sem escrever código.
$0.01 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.
Nenhum parâmetro é obrigatório. Opcionais: q (string), gl (string), hl (string), topic_token (string), kgmid (string) e publication_token (string) e mais 4. A tabela de Parâmetros e o Playground nesta página listam todos os campos.
Uma resposta JSON retornada na mesma solicitação HTTP (síncrona).
Não. Google News funciona via SandBase, então uma única chave de API da SandBase cobre este endpoint e todas as outras APIs e modelos do catálogo. Você não precisa solicitar acesso à API do Google separadamente.