News Search Client
microsoft · Developer Tools
The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for news](https://docs.microsoft.com/en-us/azure/cognitive-services/bing-news-search/search-the-web).
Authentication
Sample Requests
The News Category API lets you search on Bing and get back a list of top news articles by category. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make request
Hover any highlighted part to learn what it does
| X-BingApis-SDK | true |
curl -X GET "https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news?cc=example&mkt=example&count=10&offset=0&setLang=example&category=example&safeSearch=Off&textFormat=Raw&originalImg=true&headlineCount=1&textDecorations=true" \ -H "X-BingApis-SDK: true"
import requests
params = {
"cc": "example",
"mkt": "example",
"count": "10",
"offset": "0",
"setLang": "example",
"category": "example",
"safeSearch": "Off",
"textFormat": "Raw",
"originalImg": "true",
"headlineCount": "1",
"textDecorations": "true"
}
headers = {
"X-BingApis-SDK": "true"
}
response = requests.get(
"https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news",
params=params,
headers=headers,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news');
url.searchParams.set('cc', 'example');
url.searchParams.set('mkt', 'example');
url.searchParams.set('count', '10');
url.searchParams.set('offset', '0');
url.searchParams.set('setLang', 'example');
url.searchParams.set('category', 'example');
url.searchParams.set('safeSearch', 'Off');
url.searchParams.set('textFormat', 'Raw');
url.searchParams.set('originalImg', 'true');
url.searchParams.set('headlineCount', '1');
url.searchParams.set('textDecorations', 'true');
const response = await fetch(url, {
headers: {
'X-BingApis-SDK': 'true'
},
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news")
q := baseURL.Query()
q.Set("cc", "example")
q.Set("mkt", "example")
q.Set("count", "10")
q.Set("offset", "0")
q.Set("setLang", "example")
q.Set("category", "example")
q.Set("safeSearch", "Off")
q.Set("textFormat", "Raw")
q.Set("originalImg", "true")
q.Set("headlineCount", "1")
q.Set("textDecorations", "true")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
req.Header.Set("X-BingApis-SDK", "true")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news")
uri.query = URI.encode_www_form({
"cc" => "example",
"mkt" => "example",
"count" => "10",
"offset" => "0",
"setLang" => "example",
"category" => "example",
"safeSearch" => "Off",
"textFormat" => "Raw",
"originalImg" => "true",
"headlineCount" => "1",
"textDecorations" => "true"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
req["X-BingApis-SDK"] = "true"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news?" . http_build_query([
"cc" => "example",
"mkt" => "example",
"count" => "10",
"offset" => "0",
"setLang" => "example",
"category" => "example",
"safeSearch" => "Off",
"textFormat" => "Raw",
"originalImg" => "true",
"headlineCount" => "1",
"textDecorations" => "true"
]);
$opts = ["http" => [
"method" => "GET",
"header" => implode("\r\n", [
"X-BingApis-SDK: true"
]),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));The News Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that
Hover any highlighted part to learn what it does
| X-BingApis-SDK | true |
curl -X GET "https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news/search?q=test&cc=example&mkt=example&count=10&offset=0&sortBy=example&setLang=example&freshness=Day&safeSearch=Off&textFormat=Raw&originalImg=true&textDecorations=true" \ -H "X-BingApis-SDK: true"
import requests
params = {
"q": "test",
"cc": "example",
"mkt": "example",
"count": "10",
"offset": "0",
"sortBy": "example",
"setLang": "example",
"freshness": "Day",
"safeSearch": "Off",
"textFormat": "Raw",
"originalImg": "true",
"textDecorations": "true"
}
headers = {
"X-BingApis-SDK": "true"
}
response = requests.get(
"https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news/search",
params=params,
headers=headers,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news/search');
url.searchParams.set('q', 'test');
url.searchParams.set('cc', 'example');
url.searchParams.set('mkt', 'example');
url.searchParams.set('count', '10');
url.searchParams.set('offset', '0');
url.searchParams.set('sortBy', 'example');
url.searchParams.set('setLang', 'example');
url.searchParams.set('freshness', 'Day');
url.searchParams.set('safeSearch', 'Off');
url.searchParams.set('textFormat', 'Raw');
url.searchParams.set('originalImg', 'true');
url.searchParams.set('textDecorations', 'true');
const response = await fetch(url, {
headers: {
'X-BingApis-SDK': 'true'
},
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news/search")
q := baseURL.Query()
q.Set("q", "test")
q.Set("cc", "example")
q.Set("mkt", "example")
q.Set("count", "10")
q.Set("offset", "0")
q.Set("sortBy", "example")
q.Set("setLang", "example")
q.Set("freshness", "Day")
q.Set("safeSearch", "Off")
q.Set("textFormat", "Raw")
q.Set("originalImg", "true")
q.Set("textDecorations", "true")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
req.Header.Set("X-BingApis-SDK", "true")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news/search")
uri.query = URI.encode_www_form({
"q" => "test",
"cc" => "example",
"mkt" => "example",
"count" => "10",
"offset" => "0",
"sortBy" => "example",
"setLang" => "example",
"freshness" => "Day",
"safeSearch" => "Off",
"textFormat" => "Raw",
"originalImg" => "true",
"textDecorations" => "true"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
req["X-BingApis-SDK"] = "true"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news/search?" . http_build_query([
"q" => "test",
"cc" => "example",
"mkt" => "example",
"count" => "10",
"offset" => "0",
"sortBy" => "example",
"setLang" => "example",
"freshness" => "Day",
"safeSearch" => "Off",
"textFormat" => "Raw",
"originalImg" => "true",
"textDecorations" => "true"
]);
$opts = ["http" => [
"method" => "GET",
"header" => implode("\r\n", [
"X-BingApis-SDK: true"
]),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));The News Trending Topics API lets you search on Bing and get back a list of trending news topics that are currently trending on Bing. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For exam
Hover any highlighted part to learn what it does
| X-BingApis-SDK | true |
curl -X GET "https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news/trendingtopics?cc=example&mkt=example&count=10&since=1&offset=0&sortBy=example&setLang=example&safeSearch=Off&textFormat=Raw&textDecorations=true" \ -H "X-BingApis-SDK: true"
import requests
params = {
"cc": "example",
"mkt": "example",
"count": "10",
"since": "1",
"offset": "0",
"sortBy": "example",
"setLang": "example",
"safeSearch": "Off",
"textFormat": "Raw",
"textDecorations": "true"
}
headers = {
"X-BingApis-SDK": "true"
}
response = requests.get(
"https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news/trendingtopics",
params=params,
headers=headers,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news/trendingtopics');
url.searchParams.set('cc', 'example');
url.searchParams.set('mkt', 'example');
url.searchParams.set('count', '10');
url.searchParams.set('since', '1');
url.searchParams.set('offset', '0');
url.searchParams.set('sortBy', 'example');
url.searchParams.set('setLang', 'example');
url.searchParams.set('safeSearch', 'Off');
url.searchParams.set('textFormat', 'Raw');
url.searchParams.set('textDecorations', 'true');
const response = await fetch(url, {
headers: {
'X-BingApis-SDK': 'true'
},
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news/trendingtopics")
q := baseURL.Query()
q.Set("cc", "example")
q.Set("mkt", "example")
q.Set("count", "10")
q.Set("since", "1")
q.Set("offset", "0")
q.Set("sortBy", "example")
q.Set("setLang", "example")
q.Set("safeSearch", "Off")
q.Set("textFormat", "Raw")
q.Set("textDecorations", "true")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
req.Header.Set("X-BingApis-SDK", "true")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news/trendingtopics")
uri.query = URI.encode_www_form({
"cc" => "example",
"mkt" => "example",
"count" => "10",
"since" => "1",
"offset" => "0",
"sortBy" => "example",
"setLang" => "example",
"safeSearch" => "Off",
"textFormat" => "Raw",
"textDecorations" => "true"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
req["X-BingApis-SDK"] = "true"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/microsoft.com/cognitiveservices-NewsSearch/1.0/news/trendingtopics?" . http_build_query([
"cc" => "example",
"mkt" => "example",
"count" => "10",
"since" => "1",
"offset" => "0",
"sortBy" => "example",
"setLang" => "example",
"safeSearch" => "Off",
"textFormat" => "Raw",
"textDecorations" => "true"
]);
$opts = ["http" => [
"method" => "GET",
"header" => implode("\r\n", [
"X-BingApis-SDK: true"
]),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- See official documentation for authentication and setup.
What can you build with News Search Client?
News Search Client is a Developer Tools API. Developers commonly use developer tools APIs for:
- automating code review and quality checks
- integrating CI/CD pipelines and build systems
- managing feature flags and A/B tests
- monitoring errors and application performance
- generating and validating test data
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. News Search Client is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide · Learn about API keys · What is REST?