const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({searchBy: {type: 'entity', entity: {type: 'domain', domain: 'stripe.com'}}})
};
fetch('https://api.context.dev/v1/news/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.context.dev/v1/news/search"
payload = { "searchBy": {
"type": "entity",
"entity": {
"type": "domain",
"domain": "stripe.com"
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://api.context.dev/v1/news/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"searchBy\": {\n \"type\": \"entity\",\n \"entity\": {\n \"type\": \"domain\",\n \"domain\": \"stripe.com\"\n }\n }\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.context.dev/v1/news/search"
payload := strings.NewReader("{\n \"searchBy\": {\n \"type\": \"entity\",\n \"entity\": {\n \"type\": \"domain\",\n \"domain\": \"stripe.com\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.context.dev/v1/news/search",
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([
'searchBy' => [
'type' => 'entity',
'entity' => [
'type' => 'domain',
'domain' => 'stripe.com'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request POST \
--url https://api.context.dev/v1/news/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"searchBy": {
"type": "entity",
"entity": {
"type": "domain",
"domain": "stripe.com"
}
}
}
'{
"data": [
{
"id": "<string>",
"story_id": "<string>",
"url": "<string>",
"title": "<string>",
"description": "<string>",
"language": "<string>",
"authors": [
"<string>"
],
"image_url": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"type": "editorial",
"source": {
"name": "<string>",
"domain": "<string>",
"direct": true
},
"match": {
"level": "primary",
"confidence": 0.5
}
}
],
"has_more": true,
"next_cursor": "<string>",
"meta": {
"count": 1
},
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}Search news
Find company news by name, domain, ticker, or ISIN. Filter articles and continue through results with a cursor.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({searchBy: {type: 'entity', entity: {type: 'domain', domain: 'stripe.com'}}})
};
fetch('https://api.context.dev/v1/news/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.context.dev/v1/news/search"
payload = { "searchBy": {
"type": "entity",
"entity": {
"type": "domain",
"domain": "stripe.com"
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://api.context.dev/v1/news/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"searchBy\": {\n \"type\": \"entity\",\n \"entity\": {\n \"type\": \"domain\",\n \"domain\": \"stripe.com\"\n }\n }\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.context.dev/v1/news/search"
payload := strings.NewReader("{\n \"searchBy\": {\n \"type\": \"entity\",\n \"entity\": {\n \"type\": \"domain\",\n \"domain\": \"stripe.com\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.context.dev/v1/news/search",
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([
'searchBy' => [
'type' => 'entity',
'entity' => [
'type' => 'domain',
'domain' => 'stripe.com'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request POST \
--url https://api.context.dev/v1/news/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"searchBy": {
"type": "entity",
"entity": {
"type": "domain",
"domain": "stripe.com"
}
}
}
'{
"data": [
{
"id": "<string>",
"story_id": "<string>",
"url": "<string>",
"title": "<string>",
"description": "<string>",
"language": "<string>",
"authors": [
"<string>"
],
"image_url": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"type": "editorial",
"source": {
"name": "<string>",
"domain": "<string>",
"direct": true
},
"match": {
"level": "primary",
"confidence": 0.5
}
}
],
"has_more": true,
"next_cursor": "<string>",
"meta": {
"count": 1
},
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"request_id": "3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91",
"message": "<string>",
"error_code": "INTERNAL_ERROR",
"required_permission": "logs:read",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}Authorizations
Send Authorization: Bearer <API_KEY>. Keys have full access unless restricted to scopes.
Body
What to search for.
Show child attributes
Show child attributes
Optional result filters. Use at most one of sourceDomain, sourceCountry, articleLanguage, or articleType. A date range may accompany that category; date.from must not exceed date.to.
Show child attributes
Show child attributes
Result ordering. Defaults to newest.
Show child attributes
Show child attributes
Maximum results to return. Defaults to 10.
1 <= x <= 100Opaque next_cursor from the previous response, or null for the first page.
300Labels for filtering usage in the dashboard.
201 - 50["production", "team-alpha"]
Response
Company news results
Articles matching the search, in the requested order.
Show child attributes
Show child attributes
True when more results are available beyond this page.
Pass as cursor in the next request to fetch the following page. Null when there are no more results.
Summary information about this response.
Show child attributes
Show child attributes
Unique ID of this request, also in X-Request-Id. Include it when contacting support.
"3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91"
Credits this request used and your remaining balance.
Show child attributes
Show child attributes
Was this page helpful?