import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.news.search({
searchBy: {
entity: { name: 'xx', type: 'name' },
type: 'entity',
},
});
console.log(response.data);import os
from context.dev import ContextDev
client = ContextDev(
api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted
)
response = client.news.search(
search_by={
"entity": {
"name": "xx",
"type": "name",
},
"type": "entity",
},
)
print(response.data)package main
import (
"context"
"fmt"
"github.com/context-dot-dev/context-go-sdk"
"github.com/context-dot-dev/context-go-sdk/option"
)
func main() {
client := contextdev.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.News.Search(context.TODO(), contextdev.NewsSearchParams{
SearchBy: contextdev.NewsSearchParamsSearchBy{
Entity: contextdev.NewsSearchParamsSearchByEntityUnion{
OfName: &contextdev.NewsSearchParamsSearchByEntityName{
Name: "xx",
},
},
Type: "entity",
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
require "context_dev"
context_dev = ContextDev::Client.new(api_key: "My API Key")
response = context_dev.news.search(search_by: {entity: {name: "xx", type: :name}, type: :entity})
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ContextDev\Client;
use ContextDev\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');
try {
$response = $client->news->search(
searchBy: [
'entity' => ['name' => 'xx', 'type' => 'name'], 'type' => 'entity'
],
cursor: 'cursor',
filterBy: [
'articleLanguage' => ['ar'],
'articleType' => ['editorial'],
'date' => ['from' => 0, 'to' => 0],
'sourceCountry' => ['ae'],
'sourceDomain' => ['x'],
],
limit: 1,
sortBy: ['type' => 'relevance'],
tags: ['production', 'team-alpha'],
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}context-dev news search \
--api-key 'My API Key' \
--search-by '{entity: {name: xx, type: name}, type: entity}'curl --request POST \
--url https://api.context.dev/v1/news/search \
--header 'Content-Type: application/json' \
--data '
{
"searchBy": {
"type": "entity",
"entity": {
"type": "name",
"name": "<string>"
}
},
"filterBy": {},
"sortBy": {
"type": "newest"
},
"limit": 10,
"cursor": "<string>",
"tags": [
"production",
"team-alpha"
]
}
'HttpResponse<String> response = Unirest.post("https://api.context.dev/v1/news/search")
.header("Content-Type", "application/json")
.body("{\n \"searchBy\": {\n \"type\": \"entity\",\n \"entity\": {\n \"type\": \"name\",\n \"name\": \"<string>\"\n }\n },\n \"filterBy\": {},\n \"sortBy\": {\n \"type\": \"newest\"\n },\n \"limit\": 10,\n \"cursor\": \"<string>\",\n \"tags\": [\n \"production\",\n \"team-alpha\"\n ]\n}")
.asString();{
"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",
"source": {
"name": "<string>",
"domain": "<string>",
"direct": true
},
"match": {
"confidence": 0.5
}
}
],
"has_more": true,
"next_cursor": "<string>",
"meta": {
"count": 1
},
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}Search Company News
Search live and historical company news by name, domain, ticker, or ISIN.
import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.news.search({
searchBy: {
entity: { name: 'xx', type: 'name' },
type: 'entity',
},
});
console.log(response.data);import os
from context.dev import ContextDev
client = ContextDev(
api_key=os.environ.get("CONTEXT_DEV_API_KEY"), # This is the default and can be omitted
)
response = client.news.search(
search_by={
"entity": {
"name": "xx",
"type": "name",
},
"type": "entity",
},
)
print(response.data)package main
import (
"context"
"fmt"
"github.com/context-dot-dev/context-go-sdk"
"github.com/context-dot-dev/context-go-sdk/option"
)
func main() {
client := contextdev.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.News.Search(context.TODO(), contextdev.NewsSearchParams{
SearchBy: contextdev.NewsSearchParamsSearchBy{
Entity: contextdev.NewsSearchParamsSearchByEntityUnion{
OfName: &contextdev.NewsSearchParamsSearchByEntityName{
Name: "xx",
},
},
Type: "entity",
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
require "context_dev"
context_dev = ContextDev::Client.new(api_key: "My API Key")
response = context_dev.news.search(search_by: {entity: {name: "xx", type: :name}, type: :entity})
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ContextDev\Client;
use ContextDev\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('CONTEXT_DEV_API_KEY') ?: 'My API Key');
try {
$response = $client->news->search(
searchBy: [
'entity' => ['name' => 'xx', 'type' => 'name'], 'type' => 'entity'
],
cursor: 'cursor',
filterBy: [
'articleLanguage' => ['ar'],
'articleType' => ['editorial'],
'date' => ['from' => 0, 'to' => 0],
'sourceCountry' => ['ae'],
'sourceDomain' => ['x'],
],
limit: 1,
sortBy: ['type' => 'relevance'],
tags: ['production', 'team-alpha'],
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}context-dev news search \
--api-key 'My API Key' \
--search-by '{entity: {name: xx, type: name}, type: entity}'curl --request POST \
--url https://api.context.dev/v1/news/search \
--header 'Content-Type: application/json' \
--data '
{
"searchBy": {
"type": "entity",
"entity": {
"type": "name",
"name": "<string>"
}
},
"filterBy": {},
"sortBy": {
"type": "newest"
},
"limit": 10,
"cursor": "<string>",
"tags": [
"production",
"team-alpha"
]
}
'HttpResponse<String> response = Unirest.post("https://api.context.dev/v1/news/search")
.header("Content-Type", "application/json")
.body("{\n \"searchBy\": {\n \"type\": \"entity\",\n \"entity\": {\n \"type\": \"name\",\n \"name\": \"<string>\"\n }\n },\n \"filterBy\": {},\n \"sortBy\": {\n \"type\": \"newest\"\n },\n \"limit\": 10,\n \"cursor\": \"<string>\",\n \"tags\": [\n \"production\",\n \"team-alpha\"\n ]\n}")
.asString();{
"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",
"source": {
"name": "<string>",
"domain": "<string>",
"direct": true
},
"match": {
"confidence": 0.5
}
}
],
"has_more": true,
"next_cursor": "<string>",
"meta": {
"count": 1
},
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}{
"message": "<string>",
"key_metadata": {
"credits_consumed": 123,
"credits_remaining": 123
}
}Body
What to search for.
Show child attributes
Show child attributes
Optional result filters.
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.
300Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.
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
Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.
Show child attributes
Show child attributes
Was this page helpful?