qstringwymagane
Parameter defines the search query. You can use anything that you would use in a regular Bing search. (e.g., `'query'`, `NOT`, `OR`, `site:`, `filetype:`, `near:`, `ip:`, `loc:`, `feed:` etc.).
https://api.sandbase.ai/v1/api/bing/newsSearch Bing News by keyword and get headlines with source, date, snippet and thumbnail, filtered by freshness and market.
Twój wynik pojawi się tutaj
Uzupełnij dane wejściowe, a następnie kliknij Uruchom.
Search Bing News by keyword and get headlines with source, date, snippet and thumbnail, filtered by freshness and market.
curl -X POST "https://api.sandbase.ai/v1/api/bing/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 | Yes | Parameter defines the search query. You can use anything that you would use in a regular Bing search. (e.g., 'query', NOT, OR, site:, filetype:, near:, ip:, loc:, feed: etc.). |
mkt | string | No | The market where the results come from (e.g. en-US). Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. |
cc | string | No | Parameter defines the country to search from. It follows the 2-character ISO_3166-1 format. (e.g., us for United States, de for Germany, gb for United Kingdom, etc.). This parameter and the mkt query parameter are mutually exclusive |
first | string | No | Parameter controls the offset of the organic results. This parameter defaults to 1. (e.g., first=10 will move the 10th organic result to the first position). |
count | string | No | Parameter controls the number of results per page. This parameter is only a suggestion and might not reflect actual results returned. |
qft | string | No | Parameter defines results sorted by date. If the parameter is not set, it will default to the "Best match" sorting, otherwise, if set to: e.g. interval="4", it will show results from the past hour. Other options are: interval="7": Past |
safeSearch | string | No | Parameter defines the level of filtering for adult content. It can be set to: Off to return webpages with adult text, images, or videos. Moderate to return webpages with adult text, but not adult images or videos. Strict to not return |
device | string | No | Parameter defines the device to use to get the results. It can be set to desktop (default) to use a regular browser, tablet to use a tablet browser (currently using iPads), or mobile to use a mobile browser. |
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.
Zacznij tworzyć
Punkt końcowy API platformy z jednolitym uwierzytelnianiem i śledzeniem użycia.
curl -X POST "https://api.sandbase.ai/v1/api/bing/news" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "artificial intelligence"
}'Ustaw klucz API SandBase w środowisku serwera. Żądania używają uwierzytelniania Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Przechowuj klucz na serwerze. Nie ujawniaj go w kodzie przeglądarkowym.
qstringwymaganeParameter defines the search query. You can use anything that you would use in a regular Bing search. (e.g., `'query'`, `NOT`, `OR`, `site:`, `filetype:`, `near:`, `ip:`, `loc:`, `feed:` etc.).
mktstringThe market where the results come from (e.g. `en-US`). Typically, `mkt` is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. For a list of possible market values, see Market Codes. NOTE: If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market t
ccstringParameter defines the country to search from. It follows the 2-character ISO_3166-1 format. (e.g., `us` for United States, `de` for Germany, `gb` for United Kingdom, etc.). This parameter and the `mkt` query parameter are mutually exclusive—do not specify both. For countries with more than one language (e.g. CH, BE, CA, US), use `mkt` to choose the language.
firststringParameter controls the offset of the organic results. This parameter defaults to `1`. (e.g., `first=10` will move the 10th organic result to the first position).
countstringParameter controls the number of results per page. This parameter is only a suggestion and might not reflect actual results returned.
qftstringParameter defines results sorted by date. If the parameter is not set, it will default to the "Best match" sorting, otherwise, if set to: e.g. `interval="4"`, it will show results from the past hour. Other options are: `interval="7"`: Past 24 hours, `interval="8"`: Past 7 days, `interval="9"`: Past 30 days, `sortbydate="1"`: Most Recent
safeSearchstringParameter defines the level of filtering for adult content. It can be set to: `Off` to return webpages with adult text, images, or videos. `Moderate` to return webpages with adult text, but not adult images or videos. `Strict` to not return webpages with adult text, images, or videos.
devicestringParameter defines the device to use to get the results. It can be set to `desktop` (default) to use a regular browser, `tablet` to use a tablet browser (currently using iPads), or `mobile` to use a mobile browser.
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.
Zapisany przykładowy response dla tego API; podczas wyświetlania nie jest wykonywane żadne żądanie na żywo.
Nie opublikowano zapisanego response. Uruchom API w Playground, aby sprawdzić jego odpowiedź.
Odkryj więcej
| API | Cena | Odpowiedź |
|---|---|---|
Bing NewsTo API Bing | $0.01 za wywołanie | JSON |
Bing | $0.015 za wywołanie | JSON |
Bing | $0.015 za wywołanie | JSON |
Bing | $0.01 za wywołanie | JSON |
Bing | $0.01 za wywołanie | JSON |
Bing | $0.015 za wywołanie | JSON |
Pytania
Wyślij żądanie POST do https://api.sandbase.ai/v1/api/bing/news z kluczem API SandBase w nagłówku Authorization (Bearer) oraz parametrami w treści JSON. Możesz też wypróbować je w Playground na tej stronie bez pisania kodu.
$0.01 za wywołanie, rozliczane z salda SandBase. Płacisz tylko za wykonane wywołania; nie ma subskrypcji.
Wymagane: q (string). Opcjonalne: mkt (string), cc (string), first (string), count (string), qft (string) i safeSearch (string) i jeszcze 2. Tabela Parameters oraz Playground na tej stronie zawierają wszystkie pola.
Odpowiedź JSON zwrócona w tym samym żądaniu HTTP (synchronicznie).
Nie. Bing News działa przez SandBase, więc jeden klucz API SandBase obejmuje ten endpoint i każde inne API oraz model w katalogu. Nie musisz osobno ubiegać się o dostęp do API Bing.