Introduction
Welcome to the Corporate News API!
Currently you can use our API to access Corporate News AI assisted search features and later on several other features and endpoints related to company news around the world.
Authentication
To authorize, use this code:
# With shell, you can just pass the correct header with each request
curl "https://services.corporatenews.info/api/v1/endpoint/here" \
-H "Authorization: Token xyzxyzxyz"
Make sure to replace
xyzxyzxyz
with your API key.
Corporate News uses API keys to allow access to the API. You can register a new Corporate News API key at web application site.
You will need paid account to access the API. Corporate News API expects for the API key to be included in all API requests to the server in a header that looks like the following:
Authorization: Token xyzxyzxyz
AI Assisted Search
Get All Threads
curl "https://services.corporatenews.info/api/v1/threads/" \
-H "Authorization: Token xyzxyzxyz"
It will list all threads and their log entries in one big list. Output is in JSON format like this:
[
{
"url": "http://services.corporatenews.info/api/v1/threads/10283/",
"id": 10283,
"log_name": "a35fe6f2-b255-479e-a1a1-74be4b8cbd4b",
"user_prompt": "Hello",
"state": "finished",
"state_message": "agent finished",
"user_prompt_created_at": "2024-03-09T12:49:02.767890Z",
"alive": "2024-03-09T12:49:02.767912Z",
"bot_type": "ai-assisted-search",
"bot_response": "Hello! How can I assist you today? If you have any questions or need help with something, feel free to ask!",
"bot_response_created_at": null,
"bot_response_metadata": null
},
{
"url": "http://services.corporatenews.info/api/v1/threads/10284/",
"id": 10284,
"log_name": "a35fe6f2-b255-479e-a1a1-74be4b8cbd4b",
"user_prompt": "Latest news from technology",
"state": "finished",
"state_message": "agent finished",
"user_prompt_created_at": "2024-03-09T12:50:10.611137Z",
"alive": "2024-03-09T12:50:10.611145Z",
"bot_type": "ai-assisted-search",
"bot_response": "<long answer in markdown format>",
"bot_response_created_at": null,
"bot_response_metadata": null
},
...
]
This endpoint retrieves all threads and their log entries in one big list.
HTTP Request
GET https://services.corporatenews.info/api/v1/threads/
Get a Specific Thread
curl "https://services.corporatenews.info/api/v1/threads/a35fe6f2-b255-479e-a1a1-74be4b8cbd4b/" \
-H "Authorization: Token xyzxyzxyz"
The above command returns JSON structured like this:
[
{
"url": "http://services.corporatenews.info/api/v1/threads/10283/",
"id": 10283,
"log_name": "a35fe6f2-b255-479e-a1a1-74be4b8cbd4b",
"user_prompt": "Hello",
"state": "finished",
"state_message": "agent finished",
"user_prompt_created_at": "2024-03-09T12:49:02.767890Z",
"alive": "2024-03-09T12:49:02.767912Z",
"bot_type": "ai-assisted-search",
"bot_response": "Hello! How can I assist you today? If you have any questions or need help with something, feel free to ask!",
"bot_response_created_at": null,
"bot_response_metadata": null
},
{
"url": "http://services.corporatenews.info/api/v1/threads/10284/",
"id": 10284,
"log_name": "a35fe6f2-b255-479e-a1a1-74be4b8cbd4b",
"user_prompt": "Latest news from technology",
"state": "finished",
"state_message": "agent finished",
"user_prompt_created_at": "2024-03-09T12:50:10.611137Z",
"alive": "2024-03-09T12:50:10.611145Z",
"bot_type": "ai-assisted-search",
"bot_response": "<long answer in markdown format>",
"bot_response_created_at": null,
"bot_response_metadata": null
},
...
]
This endpoint retrieves all log entries for given log name.
HTTP Request
GET https://services.corporatenews.info/api/v1/threads/<LOG_NAME>/
URL Parameters
Parameter | Description |
---|---|
LOG_NAME | The LOG_NAME of the thread to retrieve. Log name is type of UUID e.g. a35fe6f2-b255-479e-a1a1-74be4b8cbd4b |
Create a thread with prompt from the user
curl "https://services.corporatenews.info/api/v1/threads/0a128ef5-46d5-4e99-a487-1668420f5376/" \
-X POST \
-H "Authorization: Token xyzxyzxyz" \
-H "Content-Type: application/json" \
-d '{"user_prompt":"Hello", "wait_for_response":"True"}'
The above command returns JSON structured like this:
{
"url": "http://services.corporatenews.info/api/v1/threads/10308/",
"id": 10308,
"log_name": "a35fe6f2-b255-479e-a1a1-74be4b8cbd4b",
"user_prompt": "Hello",
"state": null,
"state_message": null,
"user_prompt_created_at": "2024-03-09T13:21:34.750714Z",
"alive": "2024-03-09T13:21:34.750724Z",
"bot_type": "ai-assisted-search",
"bot_response": "Hi there! How can I assist you today?",
"bot_response_created_at": null,
"bot_response_metadata": null
}
This endpoint creates a new thread with a starting question for the AI assisted search.
HTTP Request
POST https://services.corporatenews.info/api/v1/threads/<LOG_NAME:UUID>/
URL Parameters
Parameter | Description |
---|---|
LOG_NAME:UUID | Required format is UUID. This is to be used to identify a chat thread. This is good to store on client side for further use. |
Body Parameters
Use JSON format in the body of the HTTP request. e.g. {"user_prompt":"Hello", "wait_for_response":"True"}
Parameter | Description |
---|---|
user_prompt | Search term, question etc for the AI assisted search |
wait_for_response | Use True to wait AI answer before returning the call. False is the default and will immeditialy return and you will need to query answer with seperate request. |
Newsfeed
Get Latest Publications
curl "https://services.corporatenews.info/api/v1/newsfeed/?limit=2&fields=company,date,title,link,thumbnail" \
-H "Authorization: Token xyzxyzxyz"
It will list latest publications with round-robin order using company:
[
{
"title": "Legends is top Tour on YouTube",
"link": "https://agilitypr.news/Legends-is-top-Tour-on-YouTube-40025",
"company": "Agility PR Solutions",
"date": "2024-08-08 00:09:00",
"thumbnail": {
"default": {
"url": "https://screenshots.corporatenews.info/renders/2024/8/11/9042fb8d-c31c-4b9a-a75a-9d731437874b.jpg",
"width": 384,
"height": 224
}
}
},
{
"title": "10 Quick Tips To Ensure Your Press Releases Reach the Right Audience",
"link": "https://blog.notified.com/10-quick-tips-to-ensure-your-press-releases-reach-the-right-audience",
"company": "Digital Media Innovations",
"date": "2024-08-28 00:06:31",
"thumbnail": {
"default": {
"url": "https://screenshots.corporatenews.info/renders/2024/9/7/576382ff-bc00-45fd-9d6c-3b0bf7d8a97f.jpg",
"width": 384,
"height": 224
}
}
}
]
Latest publications in past two months. Publications are in round-robin order using company.
Publications also have thumbnail image, screenshot of the web page which can be used directly as a miniature image capture of the page.
Get Parameters
Parameter | Type | Description |
---|---|---|
limit | int | Default: 10 |
fields | str | Default: company,date,title,link . List of fields to retrieve. Comma separated values of these company, date, title, link, text, thumbnail |
Get Publications by Stock Symbol
curl "https://services.corporatenews.info/api/v1/newsfeed/NOKIA.HE/?limit=2&fields=company,date,title,link,thumbnail" \
-H "Authorization: Token xyzxyzxyz"
It will list publications by given stock symbol for company ordered by publication from newest first:
[
{
"title": "Nokia is furthest in vision on the 2024 Gartner Magic Quadrantâ„¢ for CSP 5G Core Network Infrastructure Solutions.",
"link": "https://www.nokia.com/about-us/news/releases/2024/09/05/nokia-named-a-leader-in-the-2024-gartnerr-magic-quadranttm-for-csp-5g-core-network-infrastructure-solutions/",
"company": "Nokia Oyj",
"date": "2024-09-05 00:01:05",
"thumbnail": {
"default": {
"url": "https://screenshots.corporatenews.info/renders/2024/9/7/1cc4a2d6-7271-4273-b379-9459129a2d99.jpg",
"width": 384,
"height": 224
}
}
},
{
"title": "Nokia and RUCKUS Networks collaborate to deliver integrated fiber and Wi-Fi in-building/campus connectivity",
"link": "https://www.nokia.com/about-us/news/releases/2024/09/03/nokia-and-ruckus-networks-collaborate-to-deliver-integrated-fiber-and-wi-fi-in-buildingcampus-connectivity/",
"company": "Nokia Oyj",
"date": "2024-09-03 00:04:57",
"thumbnail": {
"default": {
"url": "https://screenshots.corporatenews.info/renders/2024/9/7/46ccc1af-3919-4dc7-8113-f2744024a670.jpg",
"width": 384,
"height": 224
}
}
}
]
HTTP Request
GET https://services.corporatenews.info/api/v1/newsfeed/<SYMBOL>/
URL Parameters
Parameter | Description |
---|---|
SYMBOL | Stock symbol e.g. NOKIA.HE |
Get Parameters
Parameter | Type | Description |
---|---|---|
limit | int | Default: 10 |
fields | str | Default: company,date,title,link . List of fields to retrieve. Comma separated values of these company, date, title, link, text, thumbnail |
Errors
Corporate News API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request is invalid. |
401 | Unauthorized -- Your API key is wrong. |
404 | Not Found -- The specified entry could not be found. |
405 | Method Not Allowed -- You tried to access a endpoint with an invalid method. |
406 | Not Acceptable -- You requested a format that isn't valid for the endpoint. |
429 | Too Many Requests -- You're requesting too much! Slow down! |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |