upday API v1.0
The upday news services API.
Introduction
API Reference
The upday API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
Empower your business with the upday API. Use the powerful curated personalised or recommended news experience to interact with your users.
Base URL
The upday news api delivers content in two different environments staging and production.
The staging environment gives the sample response for our content APIs and the chance to try our APIs.
Whereby in the production environment, clients will get the current content and all the features.
Base URLs:
Production: https://api.as-corporate-solutions.com
Getting Started
Here’s a collection of sample queries in Postman that’ll help you get up to speed with our APIs faster.
Important Notes:
- You must define
host,bearer_tokenandencrypted_user_id(only required for recommendations API) within an environment. - In order to receive the
clientKeyandclientSecretto generate thebearer_tokenusing auth token endpoint, please contact us.
Authentication
We use OAuth 2.0 with JWT for authenticating the requests to our content APIs.
A valid token can be generated from the auth token endpoint with a whitelisted clientKey and clientSecret.
The received bearer token should be included as Authorization header in the content API requests.
The following diagram shows the request flow:

Auth Token
This service delivers oAuth token to authorize the user to use the content APIs.
Token
Code samples
# You can also use wget
curl -X POST /v1/oauth/token?grant_type=client_credentials \
-H 'Accept: application/json'
POST /v1/oauth/token?grant_type=client_credentials HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/v1/oauth/token?grant_type=client_credentials',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.post '/v1/oauth/token',
params: {
'grant_type' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.post('/v1/oauth/token', params={
'grant_type': 'client_credentials'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/v1/oauth/token', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/oauth/token?grant_type=client_credentials");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/v1/oauth/token", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/oauth/token
This API authenticates clients by using basic auth.
The access_token from the response can be used to request contents until the token expires.
The access_token is valid for 24 hours, and a client is expected to request a new token only upon token expiration.
With a high number of requests in a short duration, the client will be rate-limited.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| grant_type | query | string | true | Grant type |
Example responses
OK
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJxY27wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw",
"token_type": "Bearer",
"expires_in": 86399,
"scope": "read write"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 401 | Unauthorized | Unauthorized | None |
| 403 | Forbidden | Forbidden | None |
| 429 | Too Many Requests | Too many requests from the client. Use expires_in from the response body to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » access_token | string | true | none | Beaer token to use the API |
| » token_type | string | true | none | Token type |
| » expires_in | integer(int64) | true | none | Expiry in seconds |
| » scope | string | true | none | Read/Write |
Top News Service
This service delivers the most important news of the day, manually curated by the UPDAY editorial teams.
It provides text and video content.
Top News Articles
Code samples
# You can also use wget
curl -X GET /v1/ntk/articles?country=string&language=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/ntk/articles?country=string&language=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/ntk/articles?country=string&language=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/ntk/articles',
params: {
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/ntk/articles', params={
'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/ntk/articles', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/ntk/articles?country=string&language=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/ntk/articles", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/ntk/articles
This API provides all currently available Top News articles.
It allows to specify the content type (text, video) as well and the number of articles you want to receive.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
| streamType | query | string | false | Valid streamType values are topnews or breakingnews which returns ntk and breaking stream respectively. By default, it returns both topnews and breakingnews articles. |
| size | query | integer(int32) | false | To limit the list size |
| contentTypes | query | array[string] | false | Valid content types are text and video.Default is set to text. |
Example responses
OK
{
"articles": [
{
"id": "288c1b08-d886-487f-a91a-1f5f6a1de0e2",
"title": "Tests show huge variety in the effectiveness of different face masks",
"url": "https://news.sky.com/story/amp/coronavirus-three-face-masks-sold-by-major-retailers-rated-a-dont-buy-by-which-12118156?",
"deepLinks": {
"upday": "http://shared.upday.com/index.html?streamType=ntk&edition=en&source=client&teaserId=288c1b08-d886-487f-a91a-1f5f6a1de0e2&articleUrl=https%3A%2F%2Fnews.sky.com%2Fstory%2Famp%2Fcoronavirus-three-face-masks-sold-by-major-retailers-rated-a-dont-buy-by-which-12118156&useCaseId=top_news"
},
"source": "Sky News",
"photoCredits": "A pedestrian walks past a Christmas light display in London on October 29, 2020.\nPicture: Getty Images",
"sourceDomain": "skynews.com",
"previewText": "-Researchers from Which? tested 15 reusable face masks of different styles and found the worst allowed 93% of particles from potentially harmful bacteria to escape.\n-Three brands were given a \"don't buy\" status: a £3 Etiquette face covering available at Superdrug, a £2.75 Asda mask, and a £2 Termini8 mask sold by Lloyds Pharmacy.",
"previewImage": "iVBORw0KGgoAAAANSUhEUgAAABAAAAAJCAMAAAAM9FwAAAAA21BMVEVxaFg/RE1UVldvZDQODQ0XGR0HBwmBdD9PSikPERWEeFGAdU5YUTKMgnOWhnB8cVV4bEaMZTSKfk+OgGNpXzYXEQwpKxkcHiBJQDA0MCa6tahSXGyVgUI+OylTSTWKeT3QtKh2dG6KZUPZ0cNnXE/Lw7JkXDasn4qLiIDm1bytllSAeW+8rJglKjK4lG8tNT80PEd3aTGSakeekn5iZ2yggX2jk2CDgXpDMBuwf0aujmjZpGrdvJZbSzI6LBzdxaVqcYKjj0yPgWjAr26xpJh5bUCQfkOaiU3Pwasb6MUYAAAAj0lEQVQI1wXBAwLDQBAAwE1y6cW27do2/v+izoBpmuhyfgy/lHkLnaWBqmZh2SaS/qq+FoMx7I+nvL1KRV8zHyPGAaiHfBBFgrg1+HkPKAZ221IGMV35vSJr/CaGyKtd14FlU2hGZ/BzyDwJjZBNknrEK5xAwQIcxNLjqS/rCnBWCBN6xLI2Qc/IZM1VAvUHKMsPLTBA0N8AAAAASUVORK5CYII=",
"category": {
"id": "sports",
"subcategories": [
"sports.basketball"
]
},
"streamType": "ntk",
"streamTypeTranslation": "Top news",
"nerTags": "Berlin, Trump",
"imageUrl": "https://xxx/image/upload/w_700,h_394,c_lfill,f_webp,q_auto:eco,g_auto:faces/v1597839918/cms-cropped/cewmckumhwntg8e1wbbf.jpg",
"contentType": "text",
"publishTime": "2020-10-30T08:04:04.954Z",
"videoUrl": "https://video.xxx.de/video/upload/w_700,h_394,q_auto:low/v1603884857/cms-cropped-videos/i66ytg2dyzhhguexmj1y.mp4",
"videoCredits": "",
"videoThumbnailUrl": "https://video.xxx.de/video/upload/w_700,h_394,so_auto,c_fill,g_auto/cms-cropped-videos/i66ytg2dyzhhguexmj1y.jpg",
"duration": 123.264,
"colorCode": "#c8102e",
"partnerUrl": "https://partnercontent.upday.com/articles/288c1b08-d886-487f-a91a-1f5f6a1de0e2",
"logoUrl": {
"lightMode": "https://www.skynews.com/logo.jpg"
}
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | Invalid content type(s), valid content types are only text and video. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » articles | [object] | true | none | List of articles |
| »» id | string | true | none | The unique id of the article |
| »» title | string | true | none | The title of the article |
| »» url | string | true | none | The url which leads to the source article |
| »» deepLinks | object | true | none | Link to the applications |
| »»» upday | string | true | none | Link to the upday app |
| »» source | string | true | none | The source of the article |
| »» photoCredits | string | false | none | The photo credits for the image of the article |
| »» sourceDomain | string | false | none | Source domain |
| »» previewText | string | true | none | The preview text of the article |
| »» previewImage | string | false | none | The preview image of the article |
| »» category | object | true | none | none |
| »»» id | string | true | none | Category name |
| »»» subcategories | [string] | true | none | Children of main category |
| »» streamType | string | true | none | The stream type of the article |
| »» streamTypeTranslation | string | true | none | The translated stream type name |
| »» nerTags | [string] | true | none | Tags |
| »» imageUrl | string | true | none | The url of the inage of the article |
| »» contentType | string | true | none | The content type of the article (text, video) |
| »» publishTime | string(date-time) | true | none | The publish time of the article |
| »» videoUrl | string | false | none | The url of the video in case the contentType is video |
| »» videoCredits | string | false | none | The credits for the video in case the contentType is video |
| »» videoThumbnailUrl | string | false | none | The url of the thumbnail of the video in-case contentType is video |
| »» duration | number(double) | false | none | The duration of the video |
| »» colorCode | string | false | none | Color code in hex format |
| »» partnerUrl | string | false | none | Partner content URL |
| »» logoUrl | object | false | none | Publisher's logo URL |
| »»» lightMode | string | true | none | Light mode logo URL of the Publisher |
Enumerated Values
| Property | Value |
|---|---|
| streamType | ntk |
| streamType | breaking |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Top News Editions
Code samples
# You can also use wget
curl -X GET /v1/ntk/editions \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/ntk/editions HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/ntk/editions',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/ntk/editions',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/ntk/editions', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/ntk/editions', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/ntk/editions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/ntk/editions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/ntk/editions
This API provides valid language & country combinations in order to receive Top News content.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | false | Country code |
| language | query | string | false | Language code |
| contentTypes | query | array[string] | false | Valid content types are text and video.Default is set to text,video. |
Example responses
OK
[
{
"country": "IT",
"language": "it",
"fullCountryName": "Italy",
"fullLanguageName": "Italian",
"locale": "it_IT",
"contentTypes": [
"text",
"video"
]
}
]
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | Invalid content type(s), valid content types are only text and video. | None |
| 404 | Not Found | Wrong country and/or language | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » country | string | true | none | Country code |
| » language | string | true | none | Language code |
| » fullCountryName | string | true | none | Full country name |
| » fullLanguageName | string | true | none | Full language name |
| » locale | string | true | none | Locale |
| » contentTypes | [string] | true | none | Supported content types |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Flash News Service
The Flash News service provides audio news briefings.
It allows to request audio episodes for specific publishers. You can get an overview of available publishers here.
Flash News Episodes
Code samples
# You can also use wget
curl -X GET /v1/flash-news/episodes?country=string&language=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/flash-news/episodes?country=string&language=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/flash-news/episodes?country=string&language=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/flash-news/episodes',
params: {
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/flash-news/episodes', params={
'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/flash-news/episodes', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/flash-news/episodes?country=string&language=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/flash-news/episodes", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/flash-news/episodes
This API provides Flash News episodes from different publishers.
It allows to specify the episode duration as well as the maximum age of a Flash News episode you want to receive.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
| durationSeconds | query | integer(int64) | false | Limits the search by duration. Valid episode durations (in seconds) are 200, 300 and 400. If this parameter is not set, there will not be any filtering for the audio duration. |
| ageHours | query | integer(int64) | false | Limits the search by age of episodes in hours. Valid values are 1, 3 and 6. Default value is set to 24. |
| sourceId | query | string | false | Limits the search by source ID. |
| localTimeZone | query | boolean | false | Provides the published time of episodes in local timezone as per the country. Default timezone is UTC. |
Example responses
OK
{
"episodes": [
{
"id": "604c5504-4038-4afe-beb2-6fef241354c8",
"title": "12:30 GMT",
"previewText": "",
"mediaFileUrl": "http://some-url.com/mp3/bbcminute2105271230.mp3",
"sourceId": "0a52b35deedc349fd7a7b4b664dce547",
"sourceName": "BBC Minute",
"imageUrl": "http://some-url.com/BBC-Minute-1024.jpg",
"codec": "mp3",
"containerFormat": "mp3",
"estimatedDurationSeconds": 60,
"estimatedFileSizeBytes": 772063,
"author": "Some author",
"publishTime": "2021-05-27T12:27:15Z"
},
{
"id": "4a97a32d-2dae-4861-a9e6-df1ca72d8738",
"title": "BBC News Thursday, 1 PM",
"previewText": "The latest news from the BBC",
"mediaFileUrl": "https://some-url.com/p09js7s8.mp3",
"sourceId": "424b3b9ee7e4c6bb1e47557ddff9e2cb",
"sourceName": "BBC News",
"imageUrl": "https://some-url.com/3000x3000/p093w8q9.jpg",
"codec": "mp3",
"containerFormat": "mp3",
"estimatedDurationSeconds": 273,
"estimatedFileSizeBytes": 4383273,
"author": "Some author",
"publishTime": "2021-05-27T12:25:24Z"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | Valid episode durations (in seconds) are 200, 300 and 400. Valid episode age (in hours) are 1, 3 and 6. |
None |
| 404 | Not Found | Wrong country and/or language. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » episodes | [object] | true | none | List of episodes |
| »» id | string | true | none | Episode ID |
| »» title | string | true | none | Episode title |
| »» previewText | string | false | none | Summary of the episode |
| »» mediaFileUrl | string | true | none | URL of the epsiode |
| »» sourceId | string | true | none | Source podcast ID |
| »» sourceName | string | true | none | Source podcast title |
| »» imageUrl | string | false | none | URL of the image. If null it means the image URL was not resolvable. |
| »» codec | string | false | none | Episode codec |
| »» containerFormat | string | false | none | Episode container format |
| »» estimatedDurationSeconds | integer(int64) | true | none | Estimated duration of the episode. It is an estimate due to dynamic advertising. |
| »» estimatedFileSizeBytes | integer(int64) | true | none | Estimated file size of the episode. It is an estimate due to dynamic advertising. |
| »» author | string | false | none | Author |
| »» publishTime | string(date-time) | true | none | Time the episode got published |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If there is no content in the response the value will be 0. If it returns 0 and there is content in the response, it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Flash News Sources
Code samples
# You can also use wget
curl -X GET /v1/flash-news/sources?country=string&language=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/flash-news/sources?country=string&language=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/flash-news/sources?country=string&language=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/flash-news/sources',
params: {
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/flash-news/sources', params={
'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/flash-news/sources', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/flash-news/sources?country=string&language=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/flash-news/sources", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/flash-news/sources
This API provides all currently available Flash News publishers by language & country combination.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
| sourceTag | query | string | false | Valid source tags are top_podcasts and flash_news. |
| durationSeconds | query | integer(int64) | false | Limits the search by duration. Valid episode durations (in seconds) are 200, 300 and 400. If this parameter is not set, there will not be any filtering for the audio duration. |
Example responses
OK
{
"sources": [
{
"sourceId": "639d735c5d5fe0b0da71a6b246834311",
"sourceName": "GQ Magazine",
"category": "sports",
"imageUrl": "https://xx/image/fetch/w_700,h_394,c_lfill,f_webp,g_auto:faces,q_auto:eco/http%3A%2F%2Fichef.bbci.co.uk%2Fimages%2Fic%2F3000x3000%2Fp08dp3tr.jpg"
},
{
"sourceId": "539d735c5d5fe0b0da71a6b246834310",
"sourceName": "BBC Radio London Update",
"category": "news",
"imageUrl": "https://xx/image/fetch/w_700,h_394,c_lfill,f_webp,g_auto:faces,q_auto:eco/http%3A%2F%2Fichef.bbci.co.uk%2Fimages%2Fic%2F3000x3000%2Fp08dp3tr.jpg"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | Valid episode durations (in seconds) are 200, 300 and 400. Valid source tags are top_podcasts and flash_news. |
None |
| 404 | Not Found | Wrong country and/or language. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » sources | [object] | true | none | List of sources |
| »» sourceId | string | true | none | Id of the source |
| »» sourceName | string | true | none | Source name |
| »» category | string | false | none | Category |
| »» imageUrl | string | true | none | URL of the image |
| »» author | string | false | none | Author |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Flash News Editions
Code samples
# You can also use wget
curl -X GET /v1/flash-news/editions \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/flash-news/editions HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/flash-news/editions',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/flash-news/editions',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/flash-news/editions', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/flash-news/editions', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/flash-news/editions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/flash-news/editions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/flash-news/editions
This API provides valid language & country combinations in order to receive Flash News content.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | false | Country code |
| language | query | string | false | Language code |
Example responses
OK
[
{
"country": "GB",
"language": "en",
"fullCountryName": "United Kingdom",
"fullLanguageName": "English",
"locale": "en_GB"
},
{
"country": "US",
"language": "en",
"fullCountryName": "United States",
"fullLanguageName": "English",
"locale": "en_US"
}
]
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 404 | Not Found | Wrong country and/or language | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » country | string | true | none | Country code |
| » language | string | true | none | Language code |
| » fullCountryName | string | true | none | Full country name |
| » fullLanguageName | string | true | none | Full language name |
| » locale | string | true | none | Locale |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
CTK News Service
Choose to know (CTK) is our news service that delivers diverse content from more than 4000 publishers.
We are providing multiple specific use cases to request content. In addition to text content the service delivers audio news as well.
Articles by category
Code samples
# You can also use wget
curl -X GET /v1/ctk/articles/categories?category=string&country=string&language=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/ctk/articles/categories?category=string&country=string&language=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/ctk/articles/categories?category=string&country=string&language=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/ctk/articles/categories',
params: {
'category' => 'string',
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/ctk/articles/categories', params={
'category': 'string', 'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/ctk/articles/categories', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/ctk/articles/categories?category=string&country=string&language=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/ctk/articles/categories", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/ctk/articles/categories
This API provides content by one of our 12 main categories like politics, sports, music etc.
You can get an overview of all supported categories here.
The service supports text and audio contents.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| category | query | string | true | Category |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
| size | query | integer(int32) | false | To limit the list size. Min = 1, Max = 200 and default value is set to 200. |
| excludedSubcategories | query | array[string] | false | List of subcategories to exclude |
| contentTypes | query | array[string] | false | Valid content types are text and audio.Default is set to text. |
| durationSeconds | query | integer(int64) | false | Limits the search by duration for audio content type. Valid values (in seconds) are 200, 300, 1800 and 3700. If this parameter is not set, there will not be any filtering for the audio duration. |
| localTimeZone | query | boolean | false | Provides the published time of articles in local timezone as per the country. Default timezone is UTC. |
| deduplicate | query | boolean | false | Returns deduplicated articles when deduplicate is true. Default value is true. |
Example responses
OK
{
"articles": [
{
"id": "bwzmLoEv7Lo5rKffmBlT_g",
"title": "Hong Kong: 4 opposition lawmakers disqualified after new law",
"url": "https://www.dw.com/en/hong-kong-4-opposition-lawmakers-disqualified-after-new-law/a-55559840?utm_medium=referral&maca=en-gk-text-upday-world-en-18533-xml-mrss&utm_source=upday",
"deepLinks": {
"upday": "https://www.upday.com/streamview?title=Politics&type=category&content=politics.miscellaneous&edition=en&source=client&article_id=bwzmLoEv7Lo5rKffmBlT_g&articleURL=https%3A%2F%2Fwww.dw.com%2Fen%2Fhong-kong-4-opposition-lawmakers-disqualified-after-new-law%2Fa-55559840%3Futm_medium%3Dreferral%26maca%3Den-gk-text-upday-world-en-18533-xml-mrss%26utm_source%3Dupday&useCaseId=category_news"
},
"source": "Deutsche Welle",
"sourceDomain": "dw.com",
"previewText": "A new bill allows the city's executive to expel lawmakers without going through the courts. Opposition legislators had threatened to resign en masse if they were targeted.",
"category": {
"id": "politics",
"subcategories": [
"politics.miscellaneous"
],
"specialCategories": [
"topnews",
"mainstream"
]
},
"streamType": "ctk",
"nerTags": [
"Hong Kong",
"Beijing",
"United States Congress",
"Carrie Lam"
],
"imageUrl": "https://xxx/image/fetch/w_700,h_394,c_lfill,f_webp,g_auto:faces,q_auto:eco/https%3A%2F%2Fstatic.dw.com%2Fimage%2F18523736_304.jpg",
"contentType": "text",
"publishTime": "2020-11-11T07:07:00Z",
"colorCode": "#c8102e",
"partnerUrl": "https://partner.upday-content.com/articles/bwzmLoEv7Lo5rKffmBlT_g??section=category_news_politics",
"logoUrl": {
"lightMode": "https://www.dw.com/logo.jpg"
},
"clusterId": "xkH4cCgOeW7bOt22dQwdWw"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | List size cannot be smaller than 1 or more than 200. Invalid content type(s), valid content types are only text and audio. Valid episode durations (in seconds) are 200, 1800 and 3700. Invalid category is provided. |
None |
| 404 | Not Found | Wrong country and/or language. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » articles | [object] | true | none | List of articles |
| »» id | string | true | none | Article ID |
| »» title | string | true | none | Title |
| »» url | string | true | none | URL |
| »» deepLinks | object | true | none | Link to the applications |
| »»» upday | string | true | none | Link to the upday app |
| »» source | string | true | none | Source name |
| »» sourceDomain | string | true | none | Source domain |
| »» previewText | string | true | none | Preview text |
| »» category | object | true | none | Article category |
| »»» id | string | true | none | Main category name |
| »»» subcategories | [string] | true | none | Children of main category |
| »»» specialCategories | [string] | true | none | Special categories |
| »» streamType | string | true | none | Type of stream |
| »» nerTags | [string] | true | none | nerTags for the article |
| »» imageUrl | string | true | none | Image URL |
| »» clusterId | string | true | none | Cluster Id |
| »» contentType | string | true | none | Content type |
| »» mediaFileUrl | string | false | none | Audio file URL is only present in the JSON when content type is audio. |
| »» duration | integer(int64) | false | none | Audio duration is only present in the JSON when content type is audio. |
| »» author | string | false | none | Author is only present in the JSON when content type is audio, however it can be null. |
| »» publishTime | string(date-time) | true | none | Time the article got published |
| »» colorCode | string | false | none | Color code in hex format |
| »» partnerUrl | string | false | none | Partner content URL |
| »» logoUrl | object | false | none | Publisher's logo URL |
| »»» lightMode | string | true | none | Light mode logo URL of the Publisher |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Articles by subcategory
Code samples
# You can also use wget
curl -X GET /v1/ctk/articles/subcategories?subcategory=string&country=string&language=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/ctk/articles/subcategories?subcategory=string&country=string&language=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/ctk/articles/subcategories?subcategory=string&country=string&language=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/ctk/articles/subcategories',
params: {
'subcategory' => 'string',
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/ctk/articles/subcategories', params={
'subcategory': 'string', 'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/ctk/articles/subcategories', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/ctk/articles/subcategories?subcategory=string&country=string&language=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/ctk/articles/subcategories", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/ctk/articles/subcategories
UPDAY supports around 90 specific topics.
You can receive news articles from subcategories like news.national, news.miscellaneous etc.
You can get an overview of all the supported subcategories here under subcategories key.
This service supports text and audio contents.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| subcategory | query | string | true | Subcategory |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
| size | query | integer(int32) | false | To limit the list size. Min = 1, Max = 200 and default value is set to 200. |
| contentTypes | query | array[string] | false | Valid content types are text and audio.Default is set to text. |
| durationSeconds | query | integer(int64) | false | Limits the search by duration for audio content type. Valid values (in seconds) are 200, 300, 1800 and 3700. If this parameter is not set, there will not be any filtering for the audio duration. |
| localTimeZone | query | boolean | false | Provides the published time of articles in local timezone as per the country. Default timezone is UTC. |
Example responses
OK
{
"articles": [
{
"id": "bwzmLoEv7Lo5rKffmBlT_g",
"title": "Hong Kong: 4 opposition lawmakers disqualified after new law",
"url": "https://www.dw.com/en/hong-kong-4-opposition-lawmakers-disqualified-after-new-law/a-55559840?utm_medium=referral&maca=en-gk-text-upday-world-en-18533-xml-mrss&utm_source=upday",
"deepLinks": {
"upday": "https://www.upday.com/streamview?title=Politics&type=category&content=politics.miscellaneous&edition=en&source=client&article_id=bwzmLoEv7Lo5rKffmBlT_g&articleURL=https%3A%2F%2Fwww.dw.com%2Fen%2Fhong-kong-4-opposition-lawmakers-disqualified-after-new-law%2Fa-55559840%3Futm_medium%3Dreferral%26maca%3Den-gk-text-upday-world-en-18533-xml-mrss%26utm_source%3Dupday&useCaseId=category_news"
},
"source": "Deutsche Welle",
"sourceDomain": "dw.com",
"previewText": "A new bill allows the city's executive to expel lawmakers without going through the courts. Opposition legislators had threatened to resign en masse if they were targeted.",
"category": {
"id": "politics",
"subcategories": [
"politics.miscellaneous"
],
"specialCategories": [
"topnews",
"mainstream"
]
},
"streamType": "ctk",
"nerTags": [
"Hong Kong",
"Beijing",
"United States Congress",
"Carrie Lam"
],
"imageUrl": "https://xxx/image/fetch/w_700,h_394,c_lfill,f_webp,g_auto:faces,q_auto:eco/https%3A%2F%2Fstatic.dw.com%2Fimage%2F18523736_304.jpg",
"contentType": "text",
"publishTime": "2020-11-11T07:07:00Z",
"colorCode": "#c8102e",
"partnerUrl": "https://partner.upday-content.com/articles/bwzmLoEv7Lo5rKffmBlT_g??section=subcategory_news_politics.miscellaneous",
"logoUrl": {
"lightMode": "https://www.dw.com/logo.jpg"
},
"clusterId": "xkH4cCgOeW7bOt22dQwdWw"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | List size cannot be smaller than 1 or more than 200. Invalid content type(s), valid content types are only text and audio. Valid episode durations (in seconds) are 200, 1800 and 3700. Invalid subcategory is provided. |
None |
| 404 | Not Found | Wrong country and/or language. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » articles | [object] | true | none | List of articles |
| »» id | string | true | none | Article ID |
| »» title | string | true | none | Title |
| »» url | string | true | none | URL |
| »» deepLinks | object | true | none | Link to the applications |
| »»» upday | string | true | none | Link to the upday app |
| »» source | string | true | none | Source name |
| »» sourceDomain | string | true | none | Source domain |
| »» previewText | string | true | none | Preview text |
| »» category | object | true | none | Article category |
| »»» id | string | true | none | Main category name |
| »»» subcategories | [string] | true | none | Children of main category |
| »»» specialCategories | [string] | true | none | Special categories |
| »» streamType | string | true | none | Type of stream |
| »» nerTags | [string] | true | none | nerTags for the article |
| »» imageUrl | string | true | none | Image URL |
| »» clusterId | string | true | none | Cluster Id |
| »» contentType | string | true | none | Content type |
| »» mediaFileUrl | string | false | none | Audio file URL is only present in the JSON when content type is audio. |
| »» duration | integer(int64) | false | none | Audio duration is only present in the JSON when content type is audio. |
| »» author | string | false | none | Author is only present in the JSON when content type is audio, however it can be null. |
| »» publishTime | string(date-time) | true | none | Time the article got published |
| »» colorCode | string | false | none | Color code in hex format |
| »» partnerUrl | string | false | none | Partner content URL |
| »» logoUrl | object | false | none | Publisher's logo URL |
| »»» lightMode | string | true | none | Light mode logo URL of the Publisher |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Articles by publisher
Code samples
# You can also use wget
curl -X GET /v1/ctk/articles/publishers?publisher=string&country=string&language=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/ctk/articles/publishers?publisher=string&country=string&language=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/ctk/articles/publishers?publisher=string&country=string&language=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/ctk/articles/publishers',
params: {
'publisher' => 'string',
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/ctk/articles/publishers', params={
'publisher': 'string', 'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/ctk/articles/publishers', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/ctk/articles/publishers?publisher=string&country=string&language=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/ctk/articles/publishers", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/ctk/articles/publishers
This API provides content by a specific publisher.
UPDAY currently has more than 4000 publishers integrated.
To get an overview of all available publishers, please check out sources API.
The service supports text and audio contents.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| publisher | query | string | true | Publisher (sourceId) |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
| size | query | integer(int32) | false | To limit the list size. Min = 1, Max = 200 and default value is set to 200. |
| contentTypes | query | array[string] | false | Valid content types are text and audio.Default is set to text. |
| durationSeconds | query | integer(int64) | false | Limits the search by duration for audio content type. Valid values (in seconds) are 200, 300, 1800 and 3700. If this parameter is not set, there will not be any filtering for audio duration. |
| localTimeZone | query | boolean | false | Provides the published time of articles in local timezone as per the country. Default timezone is UTC. |
| deduplicate | query | boolean | false | Deduplicates articles on clusterId when deduplicate is true. Default value is false. |
Example responses
OK
{
"articles": [
{
"id": "bwzmLoEv7Lo5rKffmBlT_g",
"title": "Hong Kong: 4 opposition lawmakers disqualified after new law",
"url": "https://www.dw.com/en/hong-kong-4-opposition-lawmakers-disqualified-after-new-law/a-55559840?utm_medium=referral&maca=en-gk-text-upday-world-en-18533-xml-mrss&utm_source=upday",
"deepLinks": {
"upday": "https://www.upday.com/streamview?title=Politics&type=category&content=politics.miscellaneous&edition=en&source=client&article_id=bwzmLoEv7Lo5rKffmBlT_g&articleURL=https%3A%2F%2Fwww.dw.com%2Fen%2Fhong-kong-4-opposition-lawmakers-disqualified-after-new-law%2Fa-55559840%3Futm_medium%3Dreferral%26maca%3Den-gk-text-upday-world-en-18533-xml-mrss%26utm_source%3Dupday&useCaseId=category_news"
},
"source": "Deutsche Welle",
"sourceDomain": "dw.com",
"previewText": "A new bill allows the city's executive to expel lawmakers without going through the courts. Opposition legislators had threatened to resign en masse if they were targeted.",
"category": {
"id": "politics",
"subcategories": [
"politics.miscellaneous"
],
"specialCategories": [
"topnews",
"mainstream"
]
},
"streamType": "ctk",
"nerTags": [
"Hong Kong",
"Beijing",
"United States Congress",
"Carrie Lam"
],
"imageUrl": "https://xxx/image/fetch/w_700,h_394,c_lfill,f_webp,g_auto:faces,q_auto:eco/https%3A%2F%2Fstatic.dw.com%2Fimage%2F18523736_304.jpg",
"contentType": "text",
"publishTime": "2020-11-11T07:07:00Z",
"colorCode": "#c8102e",
"partnerUrl": "https://partner.upday-content.com/articles/bwzmLoEv7Lo5rKffmBlT_g??section=publisher_news_dw.com",
"logoUrl": {
"lightMode": "https://www.dw.com/logo.jpg"
},
"clusterId": "xkH4cCgOeW7bOt22dQwdWw"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | List size cannot be smaller than 1 or more than 200. Invalid content type(s), valid content types are only text and audio. Valid episode durations (in seconds) are 200, 1800 and 3700. |
None |
| 404 | Not Found | Wrong country and/or language. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » articles | [object] | true | none | List of articles |
| »» id | string | true | none | Article ID |
| »» title | string | true | none | Title |
| »» url | string | true | none | URL |
| »» deepLinks | object | true | none | Link to the applications |
| »»» upday | string | true | none | Link to the upday app |
| »» source | string | true | none | Source name |
| »» sourceDomain | string | true | none | Source domain |
| »» previewText | string | true | none | Preview text |
| »» category | object | true | none | Article category |
| »»» id | string | true | none | Main category name |
| »»» subcategories | [string] | true | none | Children of main category |
| »»» specialCategories | [string] | true | none | Special categories |
| »» streamType | string | true | none | Type of stream |
| »» nerTags | [string] | true | none | nerTags for the article |
| »» imageUrl | string | true | none | Image URL |
| »» clusterId | string | true | none | Cluster Id |
| »» contentType | string | true | none | Content type |
| »» mediaFileUrl | string | false | none | Audio file URL is only present in the JSON when content type is audio. |
| »» duration | integer(int64) | false | none | Audio duration is only present in the JSON when content type is audio. |
| »» author | string | false | none | Author is only present in the JSON when content type is audio, however it can be null. |
| »» publishTime | string(date-time) | true | none | Time the article got published |
| »» colorCode | string | false | none | Color code in hex format |
| »» partnerUrl | string | false | none | Partner content URL |
| »» logoUrl | object | false | none | Publisher's logo URL |
| »»» lightMode | string | true | none | Light mode logo URL of the Publisher |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Articles by keyword
Code samples
# You can also use wget
curl -X GET /v1/ctk/articles/tags?tag=string&country=string&language=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/ctk/articles/tags?tag=string&country=string&language=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/ctk/articles/tags?tag=string&country=string&language=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/ctk/articles/tags',
params: {
'tag' => 'string',
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/ctk/articles/tags', params={
'tag': 'string', 'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/ctk/articles/tags', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/ctk/articles/tags?tag=string&country=string&language=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/ctk/articles/tags", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/ctk/articles/tags
This API provides articles by a keyword.
Our service supports currently more than one million keywords: brands, VIPs, football clubs and many more.
In order to receive a full list of available keywords, please send a business request to us.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| tag | query | string | true | Tag |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
| size | query | integer(int32) | false | To limit the list size. Min = 1, Max = 200 and default value is set to 200. |
| ageDays | query | integer(int64) | false | Limits the search by age of articles in days. Valid values are 1, 3, 7 and 14.Default value is set to 14. |
| localTimeZone | query | boolean | false | Provides the published time of articles in local timezone as per the country. Default timezone is UTC. |
Example responses
OK
{
"articles": [
{
"id": "bwzmLoEv7Lo5rKffmBlT_g",
"title": "Hong Kong: 4 opposition lawmakers disqualified after new law",
"url": "https://www.dw.com/en/hong-kong-4-opposition-lawmakers-disqualified-after-new-law/a-55559840?utm_medium=referral&maca=en-gk-text-upday-world-en-18533-xml-mrss&utm_source=upday",
"deepLinks": {
"upday": "https://www.upday.com/streamview?title=Politics&type=category&content=politics.miscellaneous&edition=en&source=client&article_id=bwzmLoEv7Lo5rKffmBlT_g&articleURL=https%3A%2F%2Fwww.dw.com%2Fen%2Fhong-kong-4-opposition-lawmakers-disqualified-after-new-law%2Fa-55559840%3Futm_medium%3Dreferral%26maca%3Den-gk-text-upday-world-en-18533-xml-mrss%26utm_source%3Dupday&useCaseId=category_news"
},
"source": "Deutsche Welle",
"sourceDomain": "dw.com",
"previewText": "A new bill allows the city's executive to expel lawmakers without going through the courts. Opposition legislators had threatened to resign en masse if they were targeted.",
"category": {
"id": "politics",
"subcategories": [
"politics.miscellaneous"
],
"specialCategories": [
"topnews",
"mainstream"
]
},
"streamType": "ctk",
"nerTags": [
"Hong Kong",
"Beijing",
"United States Congress",
"Carrie Lam"
],
"imageUrl": "https://xxx/image/fetch/w_700,h_394,c_lfill,f_webp,g_auto:faces,q_auto:eco/https%3A%2F%2Fstatic.dw.com%2Fimage%2F18523736_304.jpg",
"contentType": "text",
"publishTime": "2020-11-11T07:07:00Z",
"colorCode": "#c8102e",
"partnerUrl": "https://partner.upday-content.com/articles/bwzmLoEv7Lo5rKffmBlT_g??section=keyword_news_Beijing",
"logoUrl": {
"lightMode": "https://www.dw.com/logo.jpg"
},
"clusterId": "xkH4cCgOeW7bOt22dQwdWw"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | List size cannot be smaller than 1 or more than 200. Valid article ages (in days) are 1, 3, 7 and 14. |
None |
| 404 | Not Found | Wrong country and/or language. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » articles | [object] | true | none | List of articles |
| »» id | string | true | none | Article ID |
| »» title | string | true | none | Title |
| »» url | string | true | none | URL |
| »» deepLinks | object | true | none | Link to the applications |
| »»» upday | string | true | none | Link to the upday app |
| »» source | string | true | none | Source name |
| »» sourceDomain | string | true | none | Source domain |
| »» previewText | string | true | none | Preview text |
| »» category | object | true | none | Article category |
| »»» id | string | true | none | Main category name |
| »»» subcategories | [string] | true | none | Children of main category |
| »»» specialCategories | [string] | true | none | Special categories |
| »» streamType | string | true | none | Type of stream |
| »» nerTags | [string] | true | none | nerTags for the article |
| »» imageUrl | string | true | none | Image URL |
| »» clusterId | string | true | none | Cluster Id |
| »» contentType | string | true | none | Content type |
| »» mediaFileUrl | string | false | none | Audio file URL is only present in the JSON when content type is audio. |
| »» duration | integer(int64) | false | none | Audio duration is only present in the JSON when content type is audio. |
| »» author | string | false | none | Author is only present in the JSON when content type is audio, however it can be null. |
| »» publishTime | string(date-time) | true | none | Time the article got published |
| »» colorCode | string | false | none | Color code in hex format |
| »» partnerUrl | string | false | none | Partner content URL |
| »» logoUrl | object | false | none | Publisher's logo URL |
| »»» lightMode | string | true | none | Light mode logo URL of the Publisher |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Articles by collection
Code samples
# You can also use wget
curl -X GET /v1/ctk/articles/collections?collection=string&country=string&language=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/ctk/articles/collections?collection=string&country=string&language=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/ctk/articles/collections?collection=string&country=string&language=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/ctk/articles/collections',
params: {
'collection' => 'string',
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/ctk/articles/collections', params={
'collection': 'string', 'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/ctk/articles/collections', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/ctk/articles/collections?collection=string&country=string&language=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/ctk/articles/collections", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/ctk/articles/collections
UPDAY content team can create a unique news stream for you.
This service allows you to combine multiple categories and keywords available in one content stream.
It supports text and audio content.
In order to create a collection, please contact us.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| collection | query | string | true | Collection |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
| size | query | integer(int32) | false | To limit the list size. Min = 1, Max = 200 and default value is set to 200. |
| ageDays | query | integer(int64) | false | Limits the search by age of articles in days. Valid values are 1, 3, 7 and 14.Default value is set to 14. |
| contentTypes | query | array[string] | false | Valid content types are text and audio.Default is set to text. |
| durationSeconds | query | integer(int64) | false | Limits the search by duration for audio content type. Valid values (in seconds) are 200, 300, 1800 and 3700. If this parameter is not set, there will not be any filtering for the audio duration. |
| localTimeZone | query | boolean | false | Provides the published time of articles in local timezone as per the country. Default timezone is UTC. |
Example responses
OK
{
"articles": [
{
"id": "bwzmLoEv7Lo5rKffmBlT_g",
"title": "Hong Kong: 4 opposition lawmakers disqualified after new law",
"url": "https://www.dw.com/en/hong-kong-4-opposition-lawmakers-disqualified-after-new-law/a-55559840?utm_medium=referral&maca=en-gk-text-upday-world-en-18533-xml-mrss&utm_source=upday",
"deepLinks": {
"upday": "https://www.upday.com/streamview?title=Politics&type=category&content=politics.miscellaneous&edition=en&source=client&article_id=bwzmLoEv7Lo5rKffmBlT_g&articleURL=https%3A%2F%2Fwww.dw.com%2Fen%2Fhong-kong-4-opposition-lawmakers-disqualified-after-new-law%2Fa-55559840%3Futm_medium%3Dreferral%26maca%3Den-gk-text-upday-world-en-18533-xml-mrss%26utm_source%3Dupday&useCaseId=category_news"
},
"source": "Deutsche Welle",
"sourceDomain": "dw.com",
"previewText": "A new bill allows the city's executive to expel lawmakers without going through the courts. Opposition legislators had threatened to resign en masse if they were targeted.",
"category": {
"id": "politics",
"subcategories": [
"politics.miscellaneous"
],
"specialCategories": [
"topnews",
"mainstream"
]
},
"streamType": "ctk",
"nerTags": [
"Hong Kong",
"Beijing",
"United States Congress",
"Carrie Lam"
],
"imageUrl": "https://xxx/image/fetch/w_700,h_394,c_lfill,f_webp,g_auto:faces,q_auto:eco/https%3A%2F%2Fstatic.dw.com%2Fimage%2F18523736_304.jpg",
"contentType": "text",
"publishTime": "2020-11-11T07:07:00Z",
"colorCode": "#c8102e",
"partnerUrl": "https://partner.upday-content.com/articles/bwzmLoEv7Lo5rKffmBlT_g??section=collection_news_asia",
"logoUrl": {
"lightMode": "https://www.dw.com/logo.jpg"
},
"clusterId": "xkH4cCgOeW7bOt22dQwdWw"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | List size cannot be smaller than 1 or more than 200. Valid article ages (in days) are 1, 3, 7 and 14. Valid episode durations (in seconds) are 200, 1800 and 3700. Invalid content type(s), valid content types are only text and audio. |
None |
| 404 | Not Found | Wrong country and/or language. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » articles | [object] | true | none | List of articles |
| »» id | string | true | none | Article ID |
| »» title | string | true | none | Title |
| »» url | string | true | none | URL |
| »» deepLinks | object | true | none | Link to the applications |
| »»» upday | string | true | none | Link to the upday app |
| »» source | string | true | none | Source name |
| »» sourceDomain | string | true | none | Source domain |
| »» previewText | string | true | none | Preview text |
| »» category | object | true | none | Article category |
| »»» id | string | true | none | Main category name |
| »»» subcategories | [string] | true | none | Children of main category |
| »»» specialCategories | [string] | true | none | Special categories |
| »» streamType | string | true | none | Type of stream |
| »» nerTags | [string] | true | none | nerTags for the article |
| »» imageUrl | string | true | none | Image URL |
| »» clusterId | string | true | none | Cluster Id |
| »» contentType | string | true | none | Content type |
| »» mediaFileUrl | string | false | none | Audio file URL is only present in the JSON when content type is audio. |
| »» duration | integer(int64) | false | none | Audio duration is only present in the JSON when content type is audio. |
| »» author | string | false | none | Author is only present in the JSON when content type is audio, however it can be null. |
| »» publishTime | string(date-time) | true | none | Time the article got published |
| »» colorCode | string | false | none | Color code in hex format |
| »» partnerUrl | string | false | none | Partner content URL |
| »» logoUrl | object | false | none | Publisher's logo URL |
| »»» lightMode | string | true | none | Light mode logo URL of the Publisher |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
CTK Custom Collections
Code samples
# You can also use wget
curl -X GET /v1/ctk/custom-collections?country=string&language=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/ctk/custom-collections?country=string&language=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/ctk/custom-collections?country=string&language=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/ctk/custom-collections',
params: {
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/ctk/custom-collections', params={
'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/ctk/custom-collections', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/ctk/custom-collections?country=string&language=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/ctk/custom-collections", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/ctk/custom-collections
This API provides custom collections, which is curated for our clients.
Articles for each collection can be retrieved via collections endpoint.
This is only for text content type and only works with text editions and not audio.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
Example responses
OK
{
"customCollections": [
{
"name": "custom_collection_1",
"collections": [
{
"collection": "elections",
"translatedTitle": "elections",
"deepLinks": {
"upday": "https://www.upday.com/streamview?title=elections&type=collection&content=elections&edition=en&source=UPDAY&useCaseId=collection_news"
}
},
{
"collection": "brexit",
"translatedTitle": "brexit",
"deepLinks": {
"upday": "https://www.upday.com/streamview?title=brexit&type=collection&content=brexit&edition=en&source=UPDAY&useCaseId=collection_news"
}
}
]
},
{
"name": "custom_collection_2",
"collections": [
{
"collection": "football",
"translatedTitle": "football",
"deepLinks": {
"upday": "https://www.upday.com/streamview?title=football&type=collection&content=football&edition=en&source=UPDAY&useCaseId=collection_news"
}
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 404 | Not Found | Wrong country and/or language. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » customCollections | [object] | true | none | List of custom collections |
| »» name | string | true | none | Name of the custom collection |
| »» collections | [object] | true | none | List of collections belonging to the custom collection |
| »»» collection | string | true | none | Name of the collection |
| »»» translatedTitle | string | true | none | Translated title based on provided country and language. |
| »»» deepLinks | object | true | none | Link to the applications |
| »»»» upday | string | true | none | Link to the upday app |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
CTK Sources
Code samples
# You can also use wget
curl -X GET /v1/ctk/sources?country=string&language=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/ctk/sources?country=string&language=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/ctk/sources?country=string&language=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/ctk/sources',
params: {
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/ctk/sources', params={
'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/ctk/sources', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/ctk/sources?country=string&language=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/ctk/sources", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/ctk/sources
This API provides all currently available CTK publishers by language and country combination.
Articles for each source can be retrieved via publishers endpoint providing the sourceId for the publisher request parameter.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
| contentTypes | query | array[string] | false | Valid content types are text and audio.Default is set to text. |
| category | query | string | false | Article category |
| sourceTag | query | string | false | Valid source tags are top_podcasts and mainstream_podcasts. |
| durationSeconds | query | integer(int64) | false | Limits the search by duration for audio content type. Valid values (in seconds) are 200, 300, 1800 and 3700. If this parameter is not set, there will not be any filtering for the audio duration. |
| hasLogoUrl | query | boolean | false | Provides the list of sources with or without the logoUrl based on the value. When hasLogoUrl is set to true, it returns all the sources with logoUrl. When hasLogoUrl is set to false, it returns all the sources without logoUrl. When hasLogoUrl is not provided, it returns all the sources with or without the logoUrl. |
| syndicationTypes | query | array[string] | false | Valid content types are top-rss, rss and rendered. |
Example responses
OK
{
"sources": [
{
"sourceId": "gq-magazine.co.uk",
"sourceName": "GQ Magazine",
"category": "news",
"contentType": "text",
"logoUrl": {
"lightMode": "https://img.api.as-corporate-solutions.com/image/fetch/w_128,h_128,c_fill,f_webp,q_auto:eco,c_pad,b_auto:predominant_gradient:4/https%3A%2F%2Fimg.yana.asideas.de%2Fimage%2Fupload%2Fv1666686692%2Fpublisher-logo%2Fmfl-light.png"
},
"syndicationType": "rss"
},
{
"sourceId": "539d735c5d5fe0b0da71a6b246834310",
"sourceName": "BBC Radio London Update",
"category": "news",
"imageUrl": "https://xx/image/fetch/w_700,h_394,c_lfill,f_webp,g_auto:faces,q_auto:eco/http%3A%2F%2Fichef.bbci.co.uk%2Fimages%2Fic%2F3000x3000%2Fp08dp3tr.jpg",
"contentType": "audio",
"syndicationType": "top-rss"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | Invalid content type(s), valid content types are only text and audio. Valid episode durations (in seconds) are 200, 1800 and 3700. Valid source tags are top_podcasts and mainstream_podcasts. |
None |
| 404 | Not Found | Wrong country and/or language. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » sources | [object] | true | none | List of sources |
| »» sourceId | string | true | none | Id of the source |
| »» sourceName | string | true | none | Text content type: source name Audio content type: podcast title |
| »» category | string | true | none | Category |
| »» imageUrl | string | false | none | URL of the image. Only present for audio content type. |
| »» author | string | false | none | Author is only present in the JSON when content type is audio, however it can be null. |
| »» contentType | string | true | none | Content type |
| »» logoUrl | object | false | none | Publisher's logo URL. It is only present in the JSON when content type is text, however it can be null. |
| »»» lightMode | string | true | none | Light mode logo URL of the Publisher |
| »» syndicationType | string | true | none | Syndication type |
Enumerated Values
| Property | Value |
|---|---|
| syndicationType | top-rss |
| syndicationType | rss |
| syndicationType | rendered |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
CTK Editions
Code samples
# You can also use wget
curl -X GET /v1/ctk/editions \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/ctk/editions HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/ctk/editions',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/ctk/editions',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/ctk/editions', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/ctk/editions', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/ctk/editions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/ctk/editions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/ctk/editions
This API provides valid language & country combinations in order to receive CTK News content.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | false | Country code |
| language | query | string | false | Language code |
| contentTypes | query | array[string] | false | Valid content types are text and audio.Default is set to text,audio. |
Example responses
OK
[
{
"country": "IT",
"language": "it",
"fullCountryName": "Italy",
"fullLanguageName": "Italian",
"locale": "it_IT",
"contentTypes": [
"text",
"audio"
]
}
]
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | Invalid content type(s), valid content types are only text and audio. | None |
| 404 | Not Found | Wrong country and/or language | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » country | string | true | none | Country code |
| » language | string | true | none | Language code |
| » fullCountryName | string | true | none | Full country name |
| » fullLanguageName | string | true | none | Full language name |
| » locale | string | true | none | Locale |
| » contentTypes | [string] | true | none | Supported content types |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Briefing News Service
Briefing news service is our news service that delivers articles and briefings curated by our editors. Briefings for morning and evening containing the articles and related podcasts.
It also delivers spotlights which contains spotlight news with grouping articles.
Briefing
Code samples
# You can also use wget
curl -X GET /v1/briefings?country=string&language=string&briefingType=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/briefings?country=string&language=string&briefingType=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/briefings?country=string&language=string&briefingType=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/briefings',
params: {
'country' => 'string',
'language' => 'string',
'briefingType' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/briefings', params={
'country': 'string', 'language': 'string', 'briefingType': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/briefings', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/briefings?country=string&language=string&briefingType=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/briefings", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/briefings
This API provides Briefings, with types as either MORNING or EVENING. This endpoint accepts briefingType, language and country as parameters. Each briefing can contain multiple articles and if there is any related podcasts to article they will also be included.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
| briefingType | query | string | true | Determines time frame for the briefing. Valid values are: EVENING and MORNING |
Example responses
OK
{
"contents": [
{
"id": "QQoBfywKOohqWiVdBDOYWg-en-CA",
"url": "https://amp.theguardian.com/sport/2023/jan/26/duquesne-loyola-chicago-uber-eats-delivery-mcdonalds-college-basketball?utm_source=upday&utm_medium=referral",
"imageUrl": "https://i.guim.co.uk/img/media/18ce4da74124bb78dbc36584f785faba8b545e18/0_230_4376_2627/master/4376.jpg?width=1200&height=630&quality=85&auto=format&fit=crop&overlay-align=bottom%2Cleft&overlay-width=100p&overlay-base64=L2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctZGVmYXVsdC5wbmc&enable=upscale&s=20fb51ea7c48ac4101471180373d3a66",
"title": "‘Dying laughing’: Uber Eats delivery person wanders into Duquesne-Loyola game",
"previewText": "Not only did the teams have to contend with each other in their college basketball match-up, they also had to ignore the temptation of grabbing a bite",
"source": "The Guardian",
"sourceDomain": "guardian.com",
"publishTime": "2023-01-26T15:50:01.779Z",
"contentType": "text",
"category": {
"id": "sports",
"subcategories": [
"sports.basketball"
],
"specialCategories": [
"sports.basketball"
]
},
"nerTags": [
"delivery",
"Loyola Ramblers men's basketball",
"basketball"
],
"relatedPodcasts": [
{
"id": "QQoBfywKOohqWiVdBDOYWg-en-CA",
"imageUrl": "https://i.guim.co.uk/img/media/18ce4da74124bb78dbc36584f785faba8b545e18/0_230_4376_2627/master/4376.jpg?width=1200&height=630&quality=85&auto=format&fit=crop&overlay-align=bottom%2Cleft&overlay-width=100p&overlay-base64=L2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctZGVmYXVsdC5wbmc&enable=upscale&s=20fb51ea7c48ac4101471180373d3a66",
"title": "‘Dying laughing’: Uber Eats delivery person wanders into Duquesne-Loyola game",
"mediaFileUrl": "https://i.guim.co.uk/img/media/18ce4da74124bb78dbc36584f785faba8b545e18/0_230_4376_2627/master/4376.jpg?width=1200&height=630&quality=85&auto=format&fit=crop&overlay-align=bottom%2Cleft&overlay-width=100p&overlay-base64=L2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctZGVmYXVsdC5wbmc&enable=upscale&s=20fb51ea7c48ac4101471180373d3a66",
"previewText": "Not only did the teams have to contend with each other in their college basketball match-up, they also had to ignore the temptation of grabbing a bite",
"source": "The Guardian",
"sourceDomain": "guardian.com",
"publishTime": "2023-01-26T15:50:01.779Z",
"contentType": "audio",
"category": {
"id": "sports",
"subcategories": [
"sports.basketball"
],
"specialCategories": [
"sports.basketball"
]
},
"duration": "265",
"author": "john doe"
}
],
"colorCode": "#c8102e",
"partnerUrl": "https://partner.upday-content.com/articles/bwzmLoEv7Lo5rKffmBlT_g?section=briefing_news_morning",
"logoUrl": {
"lightMode": "https://www.dw.com/logo.jpg"
}
},
{
"id": "jiAgyxSsclYKjm3G2YNVQA-en-CA",
"url": "https://www.princegeorgecitizen.com/science-news/quake-shakes-east-indonesia-south-philippines-no-tsunami-6393578?utm_source=upday&utm_medium=referral",
"imageUrl": "https://www.vmcdn.ca/files/princegeorgematters/pgc-images/staff-photos/citizenlogo2021rb.svg",
"title": "Quake shakes east Indonesia, south Philippines; no tsunami",
"previewText": "JAKARTA, Indonesia (AP) — A magnitude 7.0 earthquake shook eastern Indonesia and southern Philippines on Wednesday, with no damage immediately reported and no tsunami warning issued.",
"source": "Prince George Citizen",
"sourceDomain": null,
"publishTime": "2023-01-18T08:10:05.318Z",
"contentType": "text",
"category": {
"id": "news",
"subcategories": [
"news.miscellaneous"
],
"specialCategories": [
"news.miscellaneous"
]
},
"nerTags": [],
"relatedPodcasts": [
{
"id": "4500cdf9-af02-4230-98d0-cc086",
"imageUrl": "https://megaphone.imgix.net/podcasts/127488fa-06d8-11ed-93ad-8fd9dbedbf30/image/900CHML_Omny_Bill-Kelly_v1.jpg?ixlib=rails-4.2.0&max-w=3000&max-h=3000&fit=crop&auto=format,compress",
"title": "🎧 The Bill Kelly Commentary: Why Pick A Political Fight, When You Don't Have To?",
"mediaFileUrl": "https://pdst.fm/e/chtbl.com/track/745E89/traffic.megaphone.fm/CORU4185472017.mp3?updated=1674479500",
"previewText": "",
"source": "Bill Kelly Show",
"sourceDomain": "f43770c1b4aec031d1b26c9feced306a",
"publishTime": "2023-01-23T11:44:37Z",
"category": {
"id": "news",
"subcategories": [],
"specialCategories": []
},
"contentType": "audio",
"duration": "79.0",
"author": "Bill Kelly Show"
}
]
}
],
"id": "9938788f-d2f6-40ba-8aba-b8dfe55757ef",
"briefingType": "MORNING",
"layoutType": 1,
"title": "Morning Briefing News",
"summary": "Good morning Canada",
"targetMarket": "en-CA",
"publishTime": "2023-01-19T08:10:05.318Z"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | The combination of language and country must match an Edition. valid briefingType values are MORNING and EVENING |
None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
Briefing News
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » briefingNews | [object] | true | none | List of briefings |
| »» id | string | true | none | Briefing news ID |
| »» contents | [array] | true | none | Articles of the briefing news |
| »»» id | string | true | none | Article ID |
| »»» url | string | true | none | URL |
| »»» imageUrl | string | true | none | URL to relative image |
| »»» title | string | true | none | Title |
| »»» previewText | string | true | none | Preview text |
| »»» source | string | true | none | Source |
| »»» sourceDomain | string | false | none | Source domain that article belongs to |
| »»» publishTime | string(date-time) | true | none | Time the article got published |
| »»» contentType | string | true | none | Content type |
| »»» category | object | true | none | Article category |
| »»»» id | string | true | none | Main category name |
| »»»» subcategories | [string] | true | none | Children of main category |
| »»»» specialCategories | [string] | true | none | Special categories |
| »»» nerTags | [string] | true | none | NerTag for the article |
| »»» relatedPodcasts | [array] | true | none | Podcasts related to the article |
| »»»» id | string | true | none | Podcast ID |
| »»»» imageUrl | string | true | none | URL to relative image |
| »»»» title | string | true | none | Title |
| »»»» mediaFileUrl | string | true | none | Media file URL of the podcast |
| »»»» previewText | string | true | none | Preview text |
| »»»» source | string | true | none | Source |
| »»»» sourceDomain | string | false | none | Source domain the podcast belongs to |
| »»»» publishTime | string(date-time) | true | none | Time the podcast got published |
| »»»» contentType | string | true | none | Content type |
| »»»» category | object | true | none | Article category |
| »»»»» id | string | true | none | Main category name |
| »»»»» subcategories | [string] | true | none | Children of main category |
| »»»»» specialCategories | [string] | true | none | Special categories |
| »»»» duration | integer(int64) | true | none | Duration of podcast |
| »»»» author | string | true | none | Author |
| »»» colorCode | string | false | none | Color code in hex format |
| »»» partnerUrl | string | false | none | Partner URL |
| »»» logoUrl | object | false | none | Publisher's logo URL |
| »»»» lightMode | string | true | none | Light mode logo URL of the Publisher |
| »» briefingType | string | true | none | Determines what time frame a briefing belongs to and can be either MORNING or EVENING |
| »» layoutType | integer(int64) | true | none | Layout type can be numbers from 1 to 6 |
| »» title | string | false | none | Title |
| »» summary | string | false | none | Summary |
| »» targetMarket | string | true | none | Target-market |
| »» publishTime | string(date-time) | true | none | Time the briefing got published |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Spotlight
Code samples
# You can also use wget
curl -X GET /v1/spotlights?country=string&language=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/spotlights?country=string&language=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/spotlights?country=string&language=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/spotlights',
params: {
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/spotlights', params={
'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/spotlights', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/spotlights?country=string&language=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/spotlights", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/spotlights
This service delivers a collection of news about an important topic, manually curated by the UPDAY editorial teams. It provides content grouped by background, interview, opinion and audio news.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
Example responses
OK
{
"spotlightNews": [
{
"id": "10058e43-0324-48ab-8572-668c5fea83cc",
"layoutType": 1,
"priority": "low",
"title": "Prince Harry & Co",
"topic": "Showbiz",
"summary": "Prince Harry and Prince William's wives Meghan Markle and Kate Middleton saved them from being 'lost souls'.",
"mainArticle": {
"id": "cGSV6clDdQtx8LGFGkjCeQ-en-US",
"url": "https://www.cheatsheet.com/entertainment/prince-harrys-more-laid-back-wardrobe-hints-life-california-according-royal-fashion-expert.html/?utm_source=upday&utm_medium=referral",
"imageUrl": "https://www.cheatsheet.com/wp-content/uploads/2023/03/Prince-Harry-4.jpg?w=1200",
"title": "Prince Harry’s ‘More Laid Back’ Wardrobe Hints at What Life Is Like in California, According to Royal Fashion Expert",
"previewText": "Everything about Prince Harry's California wardrobe is 'less rigid,' which, per a fashion expert, is reflective of his life in the U.S.",
"source": "Showbiz Cheat Sheet",
"sourceDomain": "cheatsheet.com",
"publishTime": "2023-04-02T23:57:00Z",
"contentType": "text",
"category": {
"id": "fashion_beauty_lifestyle",
"subcategories": [
"fashion_beauty_lifestyle.fashion"
],
"specialCategories": [
"topnews",
"rendered",
"mainstream"
]
},
"nerTags": [
"costume",
"USA",
"England",
"dress",
"suit"
],
"colorCode": "#8730b3",
"partnerUrl": "https://partner.upday-content.com/articles/cGSV6clDdQtx8LGFGkjCeQ-en-US?section=spotlight_news_showbiz",
"logoUrl": {
"lightMode": "https://img.api.as-corporate-solutions.com/image/upload/v1678372096/publisher-logo/Endgame360%20%28cheatsheet-motorbiscuit-sportscasting%29/showbiz%20Cheat%20Sheet-logo.png"
}
},
"groupings": [
{
"groupingType": "BACKGROUND",
"groupingTitle": "More VIP news",
"groupingArticles": [
{
"id": "0cHxqh0ZgEJ4myARwxa7NQ-en-US",
"url": "https://www.cheatsheet.com/entertainment/dolly-parton-called-this-her-worst-song.html/?utm_source=upday&utm_medium=referral",
"imageUrl": "https://www.cheatsheet.com/wp-content/uploads/2023/04/Dolly-Parton-1.jpg?w=1200",
"title": "Dolly Parton Called This Her Worst Song",
"previewText": "In an interview from 2003, Dolly Parton admitted she has a few songs she regrets releasing as a singer-songwriter.",
"source": "Showbiz Cheat Sheet",
"sourceDomain": "cheatsheet.com",
"publishTime": "2023-04-03T03:21:17Z",
"contentType": "text",
"category": {
"id": "music",
"subcategories": [
"music.charts_pop"
],
"specialCategories": [
"topnews",
"rendered",
"mainstream"
]
},
"nerTags": [
"Dolly Parton",
"art music",
"country music",
"Texas",
"Houston"
],
"colorCode": "#8730b3",
"partnerUrl": "https://partner.upday-content.com/articles/0cHxqh0ZgEJ4myARwxa7NQ-en-US?section=spotlight_news_showbiz",
"logoUrl": {
"lightMode": "https://img.api.as-corporate-solutions.com/image/upload/v1678372096/publisher-logo/Endgame360%20%28cheatsheet-motorbiscuit-sportscasting%29/showbiz%20Cheat%20Sheet-logo.png"
}
},
{
"id": "YBbqncPXVYs9X7hsRkEHGQ-en-US",
"url": "https://www.cheatsheet.com/entertainment/paul-mccartneys-uncomfortableness-fame-wealth-reflected-song-mrs-vanderbilt.html/?utm_source=upday&utm_medium=referral",
"imageUrl": "https://www.cheatsheet.com/wp-content/uploads/2023/04/Paul-McCartneys-Mrs.-Vanderbuilt-2.jpg?w=1200",
"title": "Paul McCartney’s Uncomfortableness With Fame and Wealth Is Reflected in His Song ‘Mrs. Vanderbilt’",
"previewText": "Paul McCartney explained that he's never fit in with the richer crowd. He wrote about it in his song, 'Mrs. Vanderbilt.'",
"source": "Showbiz Cheat Sheet",
"sourceDomain": "cheatsheet.com",
"publishTime": "2023-04-02T23:26:22Z",
"contentType": "text",
"category": {
"id": "people_shows",
"subcategories": [
"people_shows.vips"
],
"specialCategories": [
"topnews",
"rendered",
"mainstream"
]
},
"nerTags": [
"Paul McCartney",
"The Beatles",
"Fame",
"London"
],
"colorCode": "#8730b3",
"partnerUrl": "https://partner.upday-content.com/articles/YBbqncPXVYs9X7hsRkEHGQ-en-US?section=spotlight_news_showbiz",
"logoUrl": {
"lightMode": "https://img.api.as-corporate-solutions.com/image/upload/v1678372096/publisher-logo/Endgame360%20%28cheatsheet-motorbiscuit-sportscasting%29/showbiz%20Cheat%20Sheet-logo.png"
}
}
]
}
],
"publishTime": "2023-04-03T13:23:10.658Z"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | The combination of language and country must match an Edition. |
None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
Spotlight news
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » spotlightNews | [object] | true | none | List of spotlights |
| »» id | string | true | none | Spotlight news ID |
| »» layoutType | integer(int64) | true | none | Layout type can be numbers from 1 to 6 |
| »» priority | string | true | none | Spotlight's priority. Supported values are high and low. |
| »» title | string | false | none | Spotlight's title |
| »» topic | string | false | none | Spotlight's topic |
| »» summary | string | false | none | Spotlight's summary |
| »» mainArticle | object | false | none | Here is the main article of the spotlight to find |
| »»» id | string | true | none | ID of the main article |
| »»» url | string | true | none | URL of the article |
| »»» imageUrl | string | true | none | URL of the article image |
| »»» title | string | true | none | Title of the article |
| »»» previewText | string | true | none | Preview text |
| »»» source | string | true | none | Source of the article |
| »»» sourceDomain | string | false | none | Domain in which article belongs to |
| »»» publishTime | string | true | none | Time the article got published |
| »»» contentType | string | true | none | Content type which is text and audio for articles. |
| »»» category | object | true | none | Article category |
| »»»» id | string | true | none | Main category name |
| »»»» subcategories | [string] | true | none | Children of main category |
| »»»» specialCategories | [string] | true | none | Special categories |
| »»» nerTags | [string] | true | none | NerTag for the article |
| »»» colorCode | string | false | none | Color code in hex format |
| »»» partnerUrl | string | false | none | Partner URL |
| »»» logoUrl | object | false | none | Publisher's logo URL |
| »»»» lightMode | string | true | none | Light mode logo URL of the Publisher |
| »» groupings | array | true | none | Groupings of the spotlight news |
| »»» groupingType | string | true | none | Grouping type with values as INTERVIEW, BACKGROUND, OPINION and AUDIO |
| »»» groupingTitle | string | true | none | Grouping title of the spotlight |
| »»» groupingArticles | array | true | none | Articles related to the groupingType |
| »»»» id | string | true | none | ID of the article |
| »»»» url | string | true | none | URL of the article |
| »»»» imageUrl | string | true | none | URL of the article image |
| »»»» title | string | true | none | Title of the article |
| »»»» previewText | string | true | none | Preview text |
| »»»» source | string | true | none | Source of the article |
| »»»» sourceDomain | string | false | none | Domain in which article belongs to |
| »»»» publishTime | string | true | none | Time the article got published |
| »»»» contentType | string | true | none | Content type which is text and audio for articles. |
| »»»» category | object | true | none | Article category |
| »»»»» id | string | true | none | Main category name |
| »»»»» subcategories | [string] | true | none | Children of main category |
| »»»»» specialCategories | [string] | true | none | Special categories |
| »»»» nerTags | [string] | true | none | NerTag for the article |
| »»»» colorCode | string | false | none | Color code in hex format |
| »»»» partnerUrl | string | false | none | Partner URL |
| »»»» logoUrl | object | false | none | Publisher's logo URL |
| »»»»» lightMode | string | true | none | Light mode logo URL of the Publisher |
| »» publishTime | string(date-time) | true | none | Time the spotlight got published |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Trending CTK News Service
The trending service provides CTK News that is currently popular on UPDAY.
Trending articles
Code samples
# You can also use wget
curl -X GET /v1/ctk/articles/trending?country=string&language=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/ctk/articles/trending?country=string&language=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/ctk/articles/trending?country=string&language=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/ctk/articles/trending',
params: {
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/ctk/articles/trending', params={
'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/ctk/articles/trending', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/ctk/articles/trending?country=string&language=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/ctk/articles/trending", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/ctk/articles/trending
This API provides popular articles by category, subcategory, publisher or keyword based on the filters provided.
The supported country and language combinations to request content for, can be retrieved from the editions API.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
| category | query | string | false | Category |
| subcategory | query | string | false | Subcategory |
| publisher | query | string | false | Publisher |
| tag | query | string | false | Tag |
| size | query | integer(int32) | false | To limit the list size. Min = 1, Max = 200 and default value is set to 200. |
| localTimeZone | query | boolean | false | Provides the published time of articles in local timezone as per the country. Default timezone is UTC. |
| trendingPeriod | query | string | false | Trending period for articles (in hours). You can select either 12 or 24. Skipping this parameter will result in using default trending period for current category. |
Example responses
OK
{
"articles": [
{
"id": "bwzmLoEv7Lo5rKffmBlT_g",
"title": "Hong Kong: 4 opposition lawmakers disqualified after new law",
"url": "https://www.dw.com/en/hong-kong-4-opposition-lawmakers-disqualified-after-new-law/a-55559840?utm_medium=referral&maca=en-gk-text-upday-world-en-18533-xml-mrss&utm_source=upday",
"deepLinks": {
"upday": "https://www.upday.com/streamview?title=Politics&type=category&content=politics.miscellaneous&edition=en&source=client&article_id=bwzmLoEv7Lo5rKffmBlT_g&articleURL=https%3A%2F%2Fwww.dw.com%2Fen%2Fhong-kong-4-opposition-lawmakers-disqualified-after-new-law%2Fa-55559840%3Futm_medium%3Dreferral%26maca%3Den-gk-text-upday-world-en-18533-xml-mrss%26utm_source%3Dupday&useCaseId=category_news"
},
"source": "Deutsche Welle",
"sourceDomain": "dw.com",
"previewText": "A new bill allows the city's executive to expel lawmakers without going through the courts. Opposition legislators had threatened to resign en masse if they were targeted.",
"category": {
"id": "politics",
"subcategories": [
"politics.miscellaneous"
],
"specialCategories": [
"topnews",
"mainstream"
]
},
"streamType": "ctk",
"nerTags": [
"Hong Kong",
"Beijing",
"United States Congress",
"Carrie Lam"
],
"imageUrl": "https://xxx/image/fetch/w_700,h_394,c_lfill,f_webp,g_auto:faces,q_auto:eco/https%3A%2F%2Fstatic.dw.com%2Fimage%2F18523736_304.jpg",
"contentType": "text",
"publishTime": "2020-11-11T07:07:00Z",
"colorCode": "#c8102e",
"partnerUrl": "https://partner.upday-content.com/articles/bwzmLoEv7Lo5rKffmBlT_g?section=trending_news_politics",
"logoUrl": {
"lightMode": "https://www.dw.com/logo.jpg"
},
"clusterId": "xkH4cCgOeW7bOt22dQwdWw"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | List size cannot be smaller than 1 or more than 200. | None |
| 404 | Not Found | Wrong country and/or language. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » articles | [object] | true | none | List of articles |
| »» id | string | true | none | Article ID |
| »» title | string | true | none | Title |
| »» url | string | true | none | URL |
| »» deepLinks | object | true | none | Link to the applications |
| »»» upday | string | true | none | Link to the upday app |
| »» source | string | true | none | Source name |
| »» sourceDomain | string | true | none | Source domain |
| »» previewText | string | true | none | Preview text |
| »» category | object | true | none | Article category |
| »»» id | string | true | none | Main category name |
| »»» subcategories | [string] | true | none | Children of main category |
| »»» specialCategories | [string] | true | none | Special categories |
| »» streamType | string | true | none | Type of stream |
| »» nerTags | [string] | true | none | nerTags for the article |
| »» imageUrl | string | true | none | Image URL |
| »» clusterId | string | true | none | Cluster Id |
| »» contentType | string | true | none | Content type |
| »» mediaFileUrl | string | false | none | Audio file URL is only present in the JSON when content type is audio. |
| »» duration | integer(int64) | false | none | Audio duration is only present in the JSON when content type is audio. |
| »» author | string | false | none | Author is only present in the JSON when content type is audio, however it can be null. |
| »» publishTime | string(date-time) | true | none | Time the article got published |
| »» colorCode | string | false | none | Color code in hex format |
| »» partnerUrl | string | false | none | Partner content URL |
| »» logoUrl | object | false | none | Publisher's logo URL |
| »»» lightMode | string | true | none | Light mode logo URL of the Publisher |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Trending keywords
Code samples
# You can also use wget
curl -X GET /v1/ctk/trending-keywords \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/ctk/trending-keywords HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/ctk/trending-keywords',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/ctk/trending-keywords',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/ctk/trending-keywords', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/ctk/trending-keywords', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/ctk/trending-keywords");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/ctk/trending-keywords", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/ctk/trending-keywords
This API offers a list of trending topics that are popular on UPDAY.
(Currently it only provides deep links to the UPDAY app in order to discover news articles related to the topic).
The supported country and language combinations to request content for, can be retrieved from the editions API.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | false | Country code |
| language | query | string | false | Language code |
Example responses
OK
{
"trendingKeywords": [
{
"targetMarket": "en-GB",
"keywords": [
{
"keyword": "Madison",
"deepLinks": {
"upday": "https://www.upday.com/streamview?title=Madison&type=topic&content=Madison&edition=en-GB&source=client&articleURL=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dde.axelspringer.yana.zeropage&useCaseId=trending_tags"
}
},
{
"keyword": "elephant",
"deepLinks": {
"upday": "https://www.upday.com/streamview?title=elephant&type=topic&content=elephant&edition=en-GB&source=client&articleURL=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dde.axelspringer.yana.zeropage&useCaseId=trending_tags"
}
}
]
},
{
"targetMarket": "en-IE",
"keywords": [
{
"keyword": "Madison",
"deepLinks": {
"upday": "https://www.upday.com/streamview?title=Madison&type=topic&content=Madison&edition=en-IE&source=client&articleURL=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dde.axelspringer.yana.zeropage&useCaseId=trending_tags"
}
},
{
"keyword": "elephant",
"deepLinks": {
"upday": "https://www.upday.com/streamview?title=elephant&type=topic&content=elephant&edition=en-IE&source=client&articleURL=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dde.axelspringer.yana.zeropage&useCaseId=trending_tags"
}
}
]
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | Could not find trending keywords for target market 'xx-XX'. | None |
| 404 | Not Found | Wrong country and/or language. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Local News Service
The Local News API.
This service delivers all the local articles for the requested locality.
Supported regions for a country and language pair can be found by regions API.
Geolocation Regions
Code samples
# You can also use wget
curl -X GET /v1/regions \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/regions HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/regions',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/regions',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/regions', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/regions', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/regions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/regions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/regions
The Geolocation service stores geolocation regions and can serve regions based on the requested parameters.
You can receive regions that belongs to the combination of the given language and country as request parameters.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | false | Country code |
| language | query | string | false | Language code |
Example responses
OK
{
"regions": [
{
"id": "en-GB_east-midlands",
"name": "East Midlands",
"targetMarket": "en-GB",
"deeplink": "https://www.upday.com/local?localityId=en-GB_east-midlands&localityName=East+Midlands&edition=en&source=de&useCaseId=local_news_en-GB_east-midlands",
"deeplinkStreamview": "https://www.upday.com/streamview?content=en-GB_east-midlands&type=local&title=East+Midlands&edition=en&source=de&useCaseId=local_news_en-GB_east-midlands"
},
{
"id": "en-GB_east-of-england",
"name": "East of England",
"targetMarket": "en-GB",
"deeplink": "https://www.upday.com/local?localityId=en-GB_east-of-england&localityName=East+of+England&edition=en&source=de&useCaseId=local_news_en-GB_east-of-england",
"deeplinkStreamview": "https://www.upday.com/streamview?content=en-GB_east-of-england&type=local&title=East+of+England&edition=en&source=de&useCaseId=local_news_en-GB_east-of-england"
},
{
"id": "en-GB_london",
"name": "London",
"targetMarket": "en-GB",
"deeplink": "https://www.upday.com/local?localityId=en-GB_london&localityName=London&edition=en&source=de&useCaseId=local_news_en-GB_london",
"deeplinkStreamview": "https://www.upday.com/streamview?content=en-GB_london&type=local&title=London&edition=en&source=de&useCaseId=local_news_en-GB_london"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 404 | Not Found | Edition not found for given country and/or language. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » regions | [object] | true | none | List of regions |
| »» id | string | true | none | Id of the region |
| »» name | string | true | none | Region name |
| »» targetMarket | string | true | none | TargetMarket |
| »» deeplink | string | true | none | Link to the local stream in Upday app |
| »» deeplinkStreamview | string | true | none | Link to the local stream in Upday app for tablet devices |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If there is no content in the response the value will be 0. If it returns 0 and there is content in the response, it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Articles by locality
Code samples
# You can also use wget
curl -X GET /v1/ctk/local-articles?country=string&language=string&locations=string,string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/ctk/local-articles?country=string&language=string&locations=string,string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/ctk/local-articles?country=string&language=string&locations=string,string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/ctk/local-articles',
params: {
'locations' => 'array',
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/ctk/local-articles', params={
'locations': ['string','string'], 'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/ctk/local-articles?country=string&language=string&locations=string,string', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/ctk/local-articles?country=string&language=string&locations=string,string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/ctk/local-articles?country=string&language=string&locations=string,string", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/ctk/local-articles
This API provides local news articles for the requested locality.
You can get an overview of all the supported localities here.
The service supports only text articles.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| locations | query | array | true | Region Id of the locations |
| tag | query | string | false | Tag of the articles |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
| size | query | integer(int32) | false | To limit the list size. Min = 1, Max = 200 and default value is set to 200. |
| localTimeZone | query | boolean | false | Provides the published time of articles in local timezone as per the country. Default timezone is UTC. |
Example responses
OK
{
"articles": [
{
"id": "bwzmLoEv7Lo5rKffmBlT_g",
"title": "Hong Kong: 4 opposition lawmakers disqualified after new law",
"url": "http://mikasasports.com/product-tag/fivb-official-ball/page/2/",
"deepLinks": {
"upday": "https://www.upday.com/local?localityId=en-GB-wales&localityName=Wales&title=Testing-article&edition=en&source=carnival&article_id=bwzmLoEv7Lo5rKffmBlT_g&articleURL=http%3A%2F%2Fmikasasports.com%2Fproduct-tag%2Ffivb-official-ball%2Fpage%2F2%2F&useCaseId=local_news_en-GB-wales",
"streamview": "https://www.upday.com/streamview?title=Wales&type=local&content=en-GB-wales&edition=en&source=carnival&article_id=bwzmLoEv7Lo5rKffmBlT_g&articleURL=http%3A%2F%2Fmikasasports.com%2Fproduct-tag%2Ffivb-official-ball%2Fpage%2F2%2F&useCaseId=local_news_en-GB-wales"
},
"source": "Deutsche Welle",
"sourceDomain": "dw.com",
"previewText": "A new bill allows the city's executive to expel lawmakers without going through the courts. Opposition legislators had threatened to resign en masse if they were targeted.",
"category": {
"id": "politics",
"subcategories": [
"politics.miscellaneous"
],
"specialCategories": [
"topnews",
"mainstream"
]
},
"streamType": "ctk",
"nerTags": [
"Hong Kong",
"Beijing",
"United States Congress",
"Carrie Lam"
],
"imageUrl": "https://xxx/image/fetch/w_700,h_394,c_lfill,f_webp,g_auto:faces,q_auto:eco/https%3A%2F%2Fstatic.dw.com%2Fimage%2F18523736_304.jpg",
"contentType": "text",
"publishTime": "2020-11-11T07:07:00Z",
"colorCode": "#c8102e",
"partnerUrl": "https://partner.upday-content.com/articles/bwzmLoEv7Lo5rKffmBlT_g?section=local_news_hong-kong",
"logoUrl": {
"lightMode": "https://www.dw.com/logo.jpg"
}
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 400 | Bad Request | One or more of the specified locations are not supported | None |
| 404 | Not Found | Wrong country and/or language. | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » articles | [object] | true | none | List of articles |
| »» id | string | true | none | Article ID |
| »» title | string | true | none | Title |
| »» url | string | true | none | URL |
| »» deepLinks | object | true | none | Link to the applications |
| »»» upday | string | true | none | Link to the local stream in Upday app |
| »»» streamview | string | true | none | Link to the local stream in Upday app for tablet devices |
| »» source | string | true | none | Source name |
| »» sourceDomain | string | true | none | Source domain |
| »» previewText | string | true | none | Preview text |
| »» category | object | true | none | Article category |
| »»» id | string | true | none | Main category name |
| »»» subcategories | [string] | true | none | Children of main category |
| »»» specialCategories | [string] | true | none | Special categories |
| »» streamType | string | true | none | Type of stream |
| »» nerTags | [string] | true | none | nerTags for the article |
| »» imageUrl | string | true | none | Image URL |
| »» contentType | string | true | none | Content type |
| »» mediaFileUrl | string | false | none | Audio file URL is only present in the JSON when content type is audio. |
| »» duration | integer(int64) | false | none | Audio duration is only present in the JSON when content type is audio. |
| »» author | string | false | none | Author is only present in the JSON when content type is audio, however it can be null. |
| »» publishTime | string(date-time) | true | none | Time the article got published |
| »» colorCode | string | false | none | Color code in hex format |
| »» partnerUrl | string | false | none | Partner content URL |
| »» logoUrl | object | false | none | Publisher's logo URL |
| »»» lightMode | string | true | none | Light mode logo URL of the Publisher |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Categories Service
The upday categories translation API.
The API delivers an overview of supported categories and subcategories.
It provides translations for each category and subcategory based on the requested language and country.
Categories Translations
Code samples
# You can also use wget
curl -X GET /v1/categories \
-H 'Accept: application/json'
GET /v1/categories HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/v1/categories',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/v1/categories',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/v1/categories', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/categories', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/categories");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/categories", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/categories
This API provides all supported categories and subcategories with translations by country and language.
Example responses
OK
{
"categories": [
{
"id": "cars_motors",
"translations": {
"en-GB": "Cars & Transport"
},
"subcategories": {
"en-GB": "Planes"
},
"thumbnailURL": "https://something.de/image/fetch/https://sample.com/image/upload/v1568719920/categories/cars_transport.jpg"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 404 | Not Found | Wrong country and/or language | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
List of Categories with translations
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » categories | [object] | true | none | Categories |
| »» id | string | true | none | Main category |
| »» translations | object | true | none | Translation of category |
| »» subcategories | [object] | true | none | Subcategories under main category |
| »»» subcategory | string | true | none | Subcategory |
| »»» translations | object | true | none | Subcategory translation |
| »» thumbnailURL | string | true | none | Thumbnail URL of the category |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Categories Editions
Code samples
# You can also use wget
curl -X GET /v1/categories/editions \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/categories/editions HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/categories/editions',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/categories/editions',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/categories/editions', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/categories/editions', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/categories/editions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/categories/editions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/categories/editions
This API provides valid language & country combinations in order to receive categories translations.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | false | Country code |
| language | query | string | false | Language code |
Example responses
OK
[
{
"country": "GB",
"language": "en",
"fullCountryName": "United Kingdom",
"fullLanguageName": "English",
"locale": "en_GB"
},
{
"country": "IE",
"language": "en",
"fullCountryName": "Ireland",
"fullLanguageName": "English",
"locale": "en_IE"
}
]
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 404 | Not Found | Wrong country and/or language | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » country | string | true | none | Country code |
| » language | string | true | none | Language code |
| » fullCountryName | string | true | none | Full country name |
| » fullLanguageName | string | true | none | Full language name |
| » locale | string | true | none | Locale |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | X-RateLimit-Remaining | string | Displays the remaining number of requests that can be made for that second without getting rate-limited. If the request quota is exhausted, the client will be rate-limited for the respective API. |
Recommendation News Service
This service provides recommended articles based on the users' interests.
Currently it can be used only if you connect to UPDAY app.
If you are interested in receiving news recommendations, please contact us.
Reco Articles
Code samples
# You can also use wget
curl -X GET /v1/recommendations/articles?country=string&language=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw' \
-H 'Encrypted-User-Id: string'
GET /v1/recommendations/articles?country=string&language=string HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
Encrypted-User-Id: string
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
'Encrypted-User-Id':'string'
};
fetch('/v1/recommendations/articles?country=string&language=string',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
'Encrypted-User-Id' => 'string'
}
result = RestClient.get '/v1/recommendations/articles',
params: {
'country' => 'string',
'language' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
'Encrypted-User-Id': 'string'
}
r = requests.get('/v1/recommendations/articles', params={
'country': 'string', 'language': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
'Encrypted-User-Id' => 'string',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/recommendations/articles', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/recommendations/articles?country=string&language=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
"Encrypted-User-Id": []string{"string"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/recommendations/articles", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/recommendations/articles
This API provides recommended articles for the requested user by country and language.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| Encrypted-User-Id | header | string | false | Encrypted user id to get recommended articles |
| country | query | string | true | Country code |
| language | query | string | true | Language code |
Example responses
OK
{
"clusterId": "default",
"articles": [
{
"id": "en-GB-jBFsF0hzZzSgihDYTi7Bbg",
"sourceIntro": "Euronews",
"source": "Euronews",
"sourceDomain": "euronews.com",
"previewText": "It's all part of efforts to get children accustomed to Switzerland's famed direct democracy and frequent referendums. ",
"title": "D is for democracy: Swiss preschoolers learn to be good citizens",
"url": "https://www.euronews.com/2021/01/21/d-is-for-democracy-swiss-preschoolers-learn-to-be-good-citizens?utm_campaign=feeds_nocomment&utm_medium=referral&utm_source=upday",
"category": {
"id": "news",
"subcategories": [
"news.miscellaneous"
],
"specialCategories": [
"topnews",
"mainstream"
]
},
"nerTags": [],
"imageUrl": "https://image.com/image.jpg",
"deepLinks": {
"upday": "https://www.upday.com/streamview?type=recommended&edition=en-GB&title=Recommended&article_id=jBFsF0hzZzSgihDYTi7Bbg&articleUrl=https%3A%2F%2Fwww.euronews.com%2F2021%2F01%2F21%2Fd-is-for-democracy-swiss-preschoolers-learn-to-be-good-citizens%3Futm_campaign%3Dfeeds_nocomment%26utm_medium%3Dreferral%26utm_source%3Dupday&useCaseId=recommended_news&source=CARNIVAL&consent=true"
},
"contentType": "TEXT",
"publishTime": "2021-01-21T14:30:39Z"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 404 | Not Found | Wrong country and/or language | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
Recommended articles
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » clusterId | string | true | none | The clusterId from which recommended articles are served |
| » articles | [object] | true | none | Recommended articles |
| »» id | string | true | none | The unique id of the article |
| »» sourceIntro | string | false | none | The source introduction of the article |
| »» source | string | true | none | The source of the article |
| »» sourceDomain | string | true | none | Source domain |
| »» previewText | string | true | none | The preview text of the article |
| »» title | string | true | none | The title of the article |
| »» url | string | true | none | The url which leads to the source article |
| »» category | object | true | none | Article category |
| »»» id | string | true | none | Main category name |
| »»» subcategories | [string] | true | none | Subcategories under main category |
| »»» specialCategories | [string] | true | none | Special categories under main category |
| »» nerTags | [string] | true | none | Tags |
| »» imageUrl | string | true | none | The url of the inage of the article |
| »» deepLinks | object | true | none | Link to the applications |
| »»» upday | string | true | none | Link to the upday app |
| »» contentType | string | true | none | The content type of the article (text, audio, video) |
| »» publishTime | string(date-time) | true | none | The publish time of the article |
Response Headers
| Status | Header | Type | Format | Description |
|---|---|---|---|---|
| 200 | Cache-Control | string | Displays the remaining age of the cache in seconds. If it returns 0 it means by the time the cache TTL was calculated the cache had been expired and client should send a request again to get a fresh content. However, this is a rare case. |
Reco Editions
Code samples
# You can also use wget
curl -X GET /v1/recommendations/editions \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
GET /v1/recommendations/editions HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const headers = {
'Accept':'application/json',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/recommendations/editions',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.get '/v1/recommendations/editions',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.get('/v1/recommendations/editions', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/v1/recommendations/editions', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/recommendations/editions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/v1/recommendations/editions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /v1/recommendations/editions
This API provides valid language & country combinations in order to receive recommended articles.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| country | query | string | false | Country code |
| language | query | string | false | Language code |
Example responses
OK
[
{
"country": "GB",
"language": "en",
"fullCountryName": "United Kingdom",
"fullLanguageName": "English",
"locale": "en_GB"
},
{
"country": "IE",
"language": "en",
"fullCountryName": "Ireland",
"fullLanguageName": "English",
"locale": "en_IE"
}
]
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
| 404 | Not Found | Wrong country and/or language | None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » country | string | true | none | Country code |
| » language | string | true | none | Language code |
| » fullCountryName | string | true | none | Full country name |
| » fullLanguageName | string | true | none | Full language name |
| » locale | string | true | none | Locale |
Event Handler Service
The Event Handler service records all user events which helps in content personalisation.
Based on the interest of a user in previous session, we serve personalised content for the user.
You can receive recommended articles for a user here.
Event Handler
Code samples
# You can also use wget
curl -X POST /v1/events \
-H 'Content-Type: application/json' \
-H 'Accept: 0' \
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
POST /v1/events HTTP/1.1
Content-Type: application/json
Accept: 0
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw
const inputBody = '{
"eventName": "VIEWED",
"stream": "transit",
"personalisation": "true",
"attributes": {
"userId": "cdda802e-fb9c-47ad-9866-0794d394c912",
"articleId": "test-article",
"clusterId": "default-cluster",
"country": "GB",
"language": "en",
"interactionTimestamp": "2022-01-26T11:05:29.069Z"
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'0',
'Authorization':'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
};
fetch('/v1/events',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => '0',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
result = RestClient.post '/v1/events',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': '0',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw'
}
r = requests.post('/v1/events', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => '0',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/v1/events', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/v1/events");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"0"},
"Authorization": []string{"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiXSwiZXhwIjoxNjAzMzE2MDAzLCJqdGkiOiIzOGM1MDZjNi02YWRjLTRmOWMtYjY3ZS1kODUzZDgxNzdhODQiLCJjbGllbnRfaWQiOiJ1cGRheSJ9.xViL1DnwC9kmxZloRoGjn0xJwuWh1Im-mtk8c7D34-FMaHUkGH8soJHYvsD9BkO9VcIByYdcIhToKpJ6l-J9EbvZcSPyJTB4YssIMSurNHe4TXL-0gchDysHd7mKmTnfFf5dPyl0bT0pp6VJoDXWtoI74II2mCEHzHZAiy4lsnw"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/v1/events", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1/events
This API records user events.
Recorded events are used to serve personalised content by keeping content CLICKED or VIEWED in the consideration.
Body parameter
{
"eventName": "VIEWED",
"stream": "transit",
"personalisation": "true",
"attributes": {
"userId": "cdda802e-fb9c-47ad-9866-0794d394c912",
"articleId": "test-article",
"clusterId": "default-cluster",
"country": "GB",
"language": "en",
"interactionTimestamp": "2022-01-26T11:05:29.069Z"
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | string(uuid) | true | Bearer Token |
| body | body | object | true | none |
| » eventName | body | string | true | Name of the event |
| » stream | body | string | true | Access point from client's application |
| » personalisation | body | boolean | false | Determines if the user allows for content personalisation |
| » attributes | body | object | true | Event specific properties |
| »» userId | body | string | true | Unique identifier of a user |
| »» articleId | body | string | true | Id of the article with which a user interacted |
| »» clusterId | body | string | false | Id of the recommendation cluster to which a user belongs |
| »» country | body | string | true | Country code |
| »» language | body | string | true | Language code |
| »» interactionTimestamp | body | string(date-time) | false | Timestamp at which the event occurred. ISO Date time format is supported. |
Enumerated Values
| Parameter | Value |
|---|---|
| » eventName | VIEWED |
| » eventName | CLICKED |
Example responses
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Event is successfully published | None |
| 400 | Bad Request | eventName should be either VIEWED or CLICKED. stream should not be blank interactionTimestamp should be in ISO Date Time format. Wrong country and/or language |
None |
| 429 | Too Many Requests | Too many requests from the client. Use cache-control response header to make the next request upon its expiration to avoid getting rate-limited. |
None |
Response Schema
API Status (Production)
Changelog
December 8, 2020
Optional parameter deduplicate has been removed from the CTK endpoints.
API version remains the same since the parameter was optional.
February 16, 2021
Recommendations endpoint (i.e. /v1/recommendations/articles) now instead of parameter userId requires header Encrypted-User-Id.
April 26, 2021
For the NTK /v1/ntk/articles endpoint, the parameter contentType has been updated to contentTypes since it accepts a list.
July 16, 2021
For the CTK, following field validations are added to the respective endpoints:
- Categories endpoint /v1/ctk/articles/categories validates the parameter category.
- Subcategories endpoint /v1/ctk/articles/subcategories validates the parameter subcategory.