Parameters by endpoint
Title
Get articles with a specific title.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
title | Search in article titles. Supports regular keywords, exact phrases (in quotes), and proximity search (with ~N). See examples below. | string | No | Bitcoin or "breaking news" or "apple iphone"~5 |
ignore.title | The title of articles to ignore. | string | No | Ethereum |
title_starts_with | Filter articles whose title starts with the given text. | string | No | Breaking |
title_ends_with | Filter articles whose title ends with the given text. | string | No | 2025 |
title_pattern | Filter articles whose title matches the given substring pattern (LIKE). | string | No | iphone |
Title Search Syntax (Apache Solr Style)
The title parameter supports three search modes:
1. Regular Keyword Search
title=bitcoin
title=AI,innovation- Searches for keywords in any order
- ✅ Expands with synonyms and morphology
- Multiple terms with comma = OR logic
2. Exact Phrase Search (Solr Style)
title="breaking news"
title="Federal Reserve"- Searches for exact phrase in quotes
- ❌ No synonym/morphology expansion
- Words must appear in exact order
3. Proximity Search (Solr Style)
title="apple iphone"~5
title="stock market"~3- Searches for words near each other
- ~N allows words to be N positions apart
- Words must be in the correct order
- Range: ~0 to ~10
Title Search Types Comparison
| Search Type | Syntax | Synonym/Morphology Expansion | Use Case |
|---|---|---|---|
| Keyword | title=bitcoin | ✅ Yes | General search, fuzzy matching |
| Phrase | title="breaking news" | ❌ No | Exact phrases, proper names, quotes |
| Proximity | title="apple iphone"~5 | ❌ No | Words close together, flexible order |
| Prefix | title_starts_with=... | ✅ Yes | Headlines starting with term |
| Suffix | title_ends_with=... | ✅ Yes | Headlines ending with term |
| Pattern | title_pattern=... | ✅ Yes | Substring matching (LIKE) |
When to use phrase search ("..."):
- Exact quotes or proper names (e.g.,
"United Nations","Federal Reserve") - Specific event names (e.g.,
"Super Bowl 2024","World Cup Final") - Company and product names (e.g.,
"Tesla Cybertruck")
When to use proximity search ("..."~N):
- Related terms that should appear near each other
- Allow some flexibility in word distance
- Company mentions with context (e.g.,
"Apple earnings"~3)
When to use regular keyword search:
- General discovery where word order doesn't matter
- Want to find synonyms and variations
- Broader content search
Workflow examples
Request for Articles with a Specific Title Keyword:
This request retrieves news articles with "technology" in their titles.
curl "https://api.apitube.io/v1/news/everything?title=technology&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "technology",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "technology", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "technology", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "technology")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=technology&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=technology
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for Articles with Multiple Title Keywords:
This request retrieves news articles with either "AI" or "innovation" in their titles.
curl "https://api.apitube.io/v1/news/everything?title=AI,innovation&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "AI,innovation",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "AI,innovation", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "AI,innovation", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "AI,innovation")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=AI,innovation&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=AI,innovation
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for Articles with Titles Excluding Certain Words:
This request retrieves news articles that do not have "celebrity" in their titles.
curl "https://api.apitube.io/v1/news/everything?ignore.title=celebrity&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"ignore.title": "celebrity",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "ignore.title": "celebrity", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["ignore.title" => "celebrity", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("ignore.title", "celebrity")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?ignore.title=celebrity&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?ignore.title=celebrity
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCombined Title Filters for Specific News:
This request combines title filters to find articles about AI but not about job losses.
curl "https://api.apitube.io/v1/news/everything?title=AI&ignore.title=layoffs,job losses&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "AI",
"ignore.title": "layoffs,job losses",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "AI", "ignore.title": "layoffs,job losses", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "AI", "ignore.title" => "layoffs,job losses", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "AI")
q.Set("ignore.title", "layoffs,job losses")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=AI&ignore.title=layoffs,job losses&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=AI&ignore.title=layoffs,job losses
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersExact Phrase Search (Solr Style):
This request finds articles with the exact phrase "breaking news" in the title.
curl -X GET 'https://api.apitube.io/v1/news/everything?title="breaking news"&api_key=YOUR_API_KEY'import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "\"breaking news\"",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "\"breaking news\"", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "\"breaking news\"", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "\"breaking news\"")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=\"breaking news\"&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersSearch for exact organization or person names:
curl -X GET 'https://api.apitube.io/v1/news/everything?title="Federal Reserve"&api_key=YOUR_API_KEY'import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "\"Federal Reserve\"",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "\"Federal Reserve\"", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "\"Federal Reserve\"", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "\"Federal Reserve\"")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=\"Federal Reserve\"&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parameterscurl -X GET 'https://api.apitube.io/v1/news/everything?title="United Nations"&api_key=YOUR_API_KEY'import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "\"United Nations\"",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "\"United Nations\"", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "\"United Nations\"", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "\"United Nations\"")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=\"United Nations\"&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersProximity Search with Slop (Solr Style):
Find articles where "Apple" and "iPhone" appear near each other:
curl -X GET 'https://api.apitube.io/v1/news/everything?title="Apple iPhone"~5&api_key=YOUR_API_KEY'import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "\"Apple iPhone\"~5",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "\"Apple iPhone\"~5", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "\"Apple iPhone\"~5", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "\"Apple iPhone\"~5")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=\"Apple iPhone\"~5&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersThis matches titles like:
- "Apple announces new iPhone features"
- "Apple's latest iPhone release"
- "iPhone innovation from Apple"
Comparison: Regular vs. Phrase vs. Proximity:
Regular search (finds keywords in any order, with synonyms):
curl "https://api.apitube.io/v1/news/everything?title=artificial intelligence&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "artificial intelligence",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "artificial intelligence", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "artificial intelligence", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "artificial intelligence")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=artificial intelligence&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=artificial intelligence
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMatches: "Artificial Intelligence" "Intelligence in Artificial Systems", "AI", "intelligent artificial systems"
Phrase search (exact phrase only):
curl -X GET 'https://api.apitube.io/v1/news/everything?title="artificial intelligence"&api_key=YOUR_API_KEY'import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "\"artificial intelligence\"",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "\"artificial intelligence\"", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "\"artificial intelligence\"", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "\"artificial intelligence\"")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=\"artificial intelligence\"&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMatches only: "Artificial Intelligence", "artificial intelligence" (exact phrase)
Proximity search (words near each other):
curl -X GET 'https://api.apitube.io/v1/news/everything?title="artificial intelligence"~3&api_key=YOUR_API_KEY'import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "\"artificial intelligence\"~3",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "\"artificial intelligence\"~3", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "\"artificial intelligence\"~3", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "\"artificial intelligence\"~3")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=\"artificial intelligence\"~3&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMatches: "Artificial general intelligence", "Intelligence powered by artificial systems"
Company + Product Proximity Search:
Find articles mentioning company and product name near each other:
curl -X GET 'https://api.apitube.io/v1/news/everything?title="Tesla Cybertruck"~3&published_at.start=2024-01-01&api_key=YOUR_API_KEY'import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "\"Tesla Cybertruck\"~3",
"published_at.start": "2024-01-01",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "\"Tesla Cybertruck\"~3", "published_at.start": "2024-01-01", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "\"Tesla Cybertruck\"~3", "published_at.start" => "2024-01-01", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "\"Tesla Cybertruck\"~3")
q.Set("published_at.start", "2024-01-01")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=\"Tesla Cybertruck\"~3&published_at.start=2024-01-01&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersEvent Names with Exact Match:
Search for specific event names:
curl -X GET 'https://api.apitube.io/v1/news/everything?title="Super Bowl 2024"&api_key=YOUR_API_KEY'import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "\"Super Bowl 2024\"",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "\"Super Bowl 2024\"", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "\"Super Bowl 2024\"", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "\"Super Bowl 2024\"")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=\"Super Bowl 2024\"&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parameterscurl -X GET 'https://api.apitube.io/v1/news/everything?title="World Cup Final"&api_key=YOUR_API_KEY'import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "\"World Cup Final\"",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "\"World Cup Final\"", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "\"World Cup Final\"", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "\"World Cup Final\"")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=\"World Cup Final\"&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Languages
APITube has 60+ more languages available for the News API. You can specify the language of the articles you want to retrieve.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
language.code | The language code of the articles you want to retrieve. Supports up to 3 languages simultaneously, separated by commas (OR logic). | string | No | en |
ignore.language.code | The language code of the articles you want to exclude. Supports up to 3 languages simultaneously, separated by commas (OR logic). | string | No | fr |
Workflow examples
Request to get news articles excluding those from France and in the French language:
curl "https://api.apitube.io/v1/news/everything?ignore.source.country.code=fr&ignore.language.code=fr&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"ignore.source.country.code": "fr",
"ignore.language.code": "fr",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "ignore.source.country.code": "fr", "ignore.language.code": "fr", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["ignore.source.country.code" => "fr", "ignore.language.code" => "fr", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("ignore.source.country.code", "fr")
q.Set("ignore.language.code", "fr")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?ignore.source.country.code=fr&ignore.language.code=fr&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?ignore.source.country.code=fr&ignore.language.code=fr
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles in the English and French languages:
curl "https://api.apitube.io/v1/news/everything?language.code=en,fr&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"language.code": "en,fr",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "language.code": "en,fr", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["language.code" => "en,fr", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("language.code", "en,fr")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?language.code=en,fr&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?language.code=en,fr
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMulti-language Analysis with Source Filtering:
curl "https://api.apitube.io/v1/news/everything?language.code=en,ja,de&source.rank.opr.min=0.6&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"language.code": "en,ja,de",
"source.rank.opr.min": "0.6",
"sort.by": "published_at",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "language.code": "en,ja,de", "source.rank.opr.min": "0.6", "sort.by": "published_at", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["language.code" => "en,ja,de", "source.rank.opr.min" => "0.6", "sort.by" => "published_at", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("language.code", "en,ja,de")
q.Set("source.rank.opr.min", "0.6")
q.Set("sort.by", "published_at")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?language.code=en,ja,de&source.rank.opr.min=0.6&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?language.code=en,ja,de&source.rank.opr.min=0.6&sort.by=published_at&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersLanguage-Specific Business News:
curl "https://api.apitube.io/v1/news/everything?language.code=zh,ko&category.id=medtop:04000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"language.code": "zh,ko",
"category.id": "medtop:04000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "language.code": "zh,ko", "category.id": "medtop:04000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["language.code" => "zh,ko", "category.id" => "medtop:04000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("language.code", "zh,ko")
q.Set("category.id", "medtop:04000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?language.code=zh,ko&category.id=medtop:04000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?language.code=zh,ko&category.id=medtop:04000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMultilingual Organization Sentiment Analysis:
curl "https://api.apitube.io/v1/news/everything?language.code=en,fr,de&organization.name=Netflix&sentiment.overall.polarity=positive&sort.by=published_at&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"language.code": "en,fr,de",
"organization.name": "Netflix",
"sentiment.overall.polarity": "positive",
"sort.by": "published_at",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "language.code": "en,fr,de", "organization.name": "Netflix", "sentiment.overall.polarity": "positive", "sort.by": "published_at", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["language.code" => "en,fr,de", "organization.name" => "Netflix", "sentiment.overall.polarity" => "positive", "sort.by" => "published_at", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("language.code", "en,fr,de")
q.Set("organization.name", "Netflix")
q.Set("sentiment.overall.polarity", "positive")
q.Set("sort.by", "published_at")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?language.code=en,fr,de&organization.name=Netflix&sentiment.overall.polarity=positive&sort.by=published_at&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?language.code=en,fr,de&organization.name=Netflix&sentiment.overall.polarity=positive&sort.by=published_at
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRegional Language News Comparison:
curl "https://api.apitube.io/v1/news/everything?language.code=ar,he&category.id=medtop:11000000&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"language.code": "ar,he",
"category.id": "medtop:11000000",
"sort.by": "sentiment.overall.score",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "language.code": "ar,he", "category.id": "medtop:11000000", "sort.by": "sentiment.overall.score", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["language.code" => "ar,he", "category.id" => "medtop:11000000", "sort.by" => "sentiment.overall.score", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("language.code", "ar,he")
q.Set("category.id", "medtop:11000000")
q.Set("sort.by", "sentiment.overall.score")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?language.code=ar,he&category.id=medtop:11000000&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?language.code=ar,he&category.id=medtop:11000000&sort.by=sentiment.overall.score
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Trends
Get trending values for a specific field, ranked by article count. Discover the most popular entities, categories, topics, sources, and more.
Endpoints
/v1/news/trends
Parameters
| Parameter | Description | Type | Required | Default | Example |
|---|---|---|---|---|---|
field | The field(s) to aggregate trends on. Supports up to 5 comma-separated fields. See allowed fields below. | string | Yes | - | entity.id or entity.id,category.id |
per_page | Number of top results to return per field. Min: 1, Max: 100. | integer | No | 10 | 20 |
offset | Number of results to skip for pagination. | integer | No | 0 | 10 |
sort | Field to sort results by. | string | No | count | trending_score |
order | Sort order. | string | No | desc | asc |
mincount | Minimum number of articles required for a trend to appear. Min: 1, Max: 10000. | integer | No | 1 | 100 |
percentile | Filter results to top N percentile by count. Range: 1-100. | integer | No | - | 90 |
time_bucket | Group results by time interval. | string | No | - | day |
trending | Enable trending analysis with history and score calculation. | boolean | No | false | true |
trending_days | Number of days to analyze for trending calculation. Min: 7, Max: 30. | integer | No | 14 | 7 |
compare | Enable comparison with a previous time period. | boolean | No | false | true |
compare_window | Time window for comparison (required when compare=true). | string | Conditional | - | 7DAYS |
All standard news filters (title, published_at.start, source.id, language.code, etc.) are also supported to narrow the result set before aggregation.
Sort values
| Value | Description | Availability |
|---|---|---|
count | Sort by article count (most popular first) | Always |
value | Sort alphabetically by trend value | Always |
growth_rate | Sort by publication velocity (articles per hour) | Always |
change | Sort by percentage change from previous period | Only when compare=true |
trending_score | Sort by trending score (recent vs historical activity) | Only when compare=true |
Time bucket values
| Value | Description | Example output |
|---|---|---|
hour | Group by hour | 2024-01-15 14:00 |
day | Group by day | 2024-01-15 |
week | Group by week start | 2024-01-15 |
month | Group by month | 2024-01 |
Compare window formats
| Format | Description | Example |
|---|---|---|
NHOURS | N hours ago | 24HOURS |
NDAYS | N days ago | 7DAYS |
NWEEK | N weeks ago | 1WEEK |
Nw | N weeks (short) | 2w |
Nm | N months (short) | 1m |
Response fields
When trending=true, each trend includes:
| Field | Description |
|---|---|
trending_score | Ratio of recent (2-day) to historical (14-day) average. Score > 1 = rising trend, < 1 = declining. |
trending_history | Object with daily counts ({ "2024-01-15": 42, ... }) |
growth_rate | Articles per hour between first and last seen |
percentage | Percentage of total articles matching this trend |
When compare=true, each trend includes:
| Field | Description |
|---|---|
previous_count | Article count in the comparison period |
change_absolute | Absolute difference (current - previous) |
change_percent | Percentage change from previous period |
Allowed fields
| Field | Description |
|---|---|
category.id | Trending categories (enriched with name and taxonomy) |
topic.id | Trending topics (enriched with name) |
industry.id | Trending industries (enriched with name) |
entity.id | Trending entities (enriched with name, type, and Wikidata ID) |
source.id | Trending sources (enriched with name and domain) |
Workflow examples
Get the top 10 trending entities in technology news:
curl "https://api.apitube.io/v1/news/trends?field=entity.id&per_page=10&title=technology&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/trends",
params={
"field": "entity.id",
"per_page": "10",
"title": "technology",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "field": "entity.id", "per_page": "10", "title": "technology", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/trends?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["field" => "entity.id", "per_page" => "10", "title" => "technology", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/trends?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/trends")
q := u.Query()
q.Set("field", "entity.id")
q.Set("per_page", "10")
q.Set("title", "technology")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/trends?field=entity.id&per_page=10&title=technology&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/trends?field=entity.id&per_page=10&title=technology
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersGet top trending categories for the past week:
curl "https://api.apitube.io/v1/news/trends?field=category.id&published_at.start=NOW-7DAY&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/trends",
params={
"field": "category.id",
"published_at.start": "NOW-7DAY",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "field": "category.id", "published_at.start": "NOW-7DAY", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/trends?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["field" => "category.id", "published_at.start" => "NOW-7DAY", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/trends?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/trends")
q := u.Query()
q.Set("field", "category.id")
q.Set("published_at.start", "NOW-7DAY")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/trends?field=category.id&published_at.start=NOW-7DAY&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/trends?field=category.id&published_at.start=NOW-7DAY
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersGet top trending sources for English-language news:
curl "https://api.apitube.io/v1/news/trends?field=source.id&language.code=en&per_page=20&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/trends",
params={
"field": "source.id",
"language.code": "en",
"per_page": "20",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "field": "source.id", "language.code": "en", "per_page": "20", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/trends?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["field" => "source.id", "language.code" => "en", "per_page" => "20", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/trends?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/trends")
q := u.Query()
q.Set("field", "source.id")
q.Set("language.code", "en")
q.Set("per_page", "20")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/trends?field=source.id&language.code=en&per_page=20&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/trends?field=source.id&language.code=en&per_page=20
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersAnalyze multiple fields at once:
curl "https://api.apitube.io/v1/news/trends?field=entity.id,category.id,topic.id&per_page=5&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/trends",
params={
"field": "entity.id,category.id,topic.id",
"per_page": "5",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "field": "entity.id,category.id,topic.id", "per_page": "5", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/trends?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["field" => "entity.id,category.id,topic.id", "per_page" => "5", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/trends?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/trends")
q := u.Query()
q.Set("field", "entity.id,category.id,topic.id")
q.Set("per_page", "5")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/trends?field=entity.id,category.id,topic.id&per_page=5&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/trends?field=entity.id,category.id,topic.id&per_page=5
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersGet trending topics with trending score and history:
curl "https://api.apitube.io/v1/news/trends?field=topic.id&trending=true&trending_days=14&sort=trending_score&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/trends",
params={
"field": "topic.id",
"trending": "true",
"trending_days": "14",
"sort": "trending_score",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "field": "topic.id", "trending": "true", "trending_days": "14", "sort": "trending_score", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/trends?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["field" => "topic.id", "trending" => "true", "trending_days" => "14", "sort" => "trending_score", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/trends?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/trends")
q := u.Query()
q.Set("field", "topic.id")
q.Set("trending", "true")
q.Set("trending_days", "14")
q.Set("sort", "trending_score")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/trends?field=topic.id&trending=true&trending_days=14&sort=trending_score&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/trends?field=topic.id&trending=true&trending_days=14&sort=trending_score
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCompare entity trends with last week:
curl "https://api.apitube.io/v1/news/trends?field=entity.id&compare=true&compare_window=7DAYS&sort=change&order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/trends",
params={
"field": "entity.id",
"compare": "true",
"compare_window": "7DAYS",
"sort": "change",
"order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "field": "entity.id", "compare": "true", "compare_window": "7DAYS", "sort": "change", "order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/trends?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["field" => "entity.id", "compare" => "true", "compare_window" => "7DAYS", "sort" => "change", "order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/trends?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/trends")
q := u.Query()
q.Set("field", "entity.id")
q.Set("compare", "true")
q.Set("compare_window", "7DAYS")
q.Set("sort", "change")
q.Set("order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/trends?field=entity.id&compare=true&compare_window=7DAYS&sort=change&order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/trends?field=entity.id&compare=true&compare_window=7DAYS&sort=change&order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersGet a daily breakdown of category trends:
curl "https://api.apitube.io/v1/news/trends?field=category.id&time_bucket=day&published_at.start=NOW-30DAY&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/trends",
params={
"field": "category.id",
"time_bucket": "day",
"published_at.start": "NOW-30DAY",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "field": "category.id", "time_bucket": "day", "published_at.start": "NOW-30DAY", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/trends?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["field" => "category.id", "time_bucket" => "day", "published_at.start" => "NOW-30DAY", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/trends?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/trends")
q := u.Query()
q.Set("field", "category.id")
q.Set("time_bucket", "day")
q.Set("published_at.start", "NOW-30DAY")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/trends?field=category.id&time_bucket=day&published_at.start=NOW-30DAY&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/trends?field=category.id&time_bucket=day&published_at.start=NOW-30DAY
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersFilter to the top 10% most mentioned entities:
curl "https://api.apitube.io/v1/news/trends?field=entity.id&percentile=90&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/trends",
params={
"field": "entity.id",
"percentile": "90",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "field": "entity.id", "percentile": "90", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/trends?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["field" => "entity.id", "percentile" => "90", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/trends?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/trends")
q := u.Query()
q.Set("field", "entity.id")
q.Set("percentile", "90")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/trends?field=entity.id&percentile=90&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/trends?field=entity.id&percentile=90
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersGet only entities with at least 100 articles:
curl "https://api.apitube.io/v1/news/trends?field=entity.id&mincount=100&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/trends",
params={
"field": "entity.id",
"mincount": "100",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "field": "entity.id", "mincount": "100", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/trends?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["field" => "entity.id", "mincount" => "100", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/trends?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/trends")
q := u.Query()
q.Set("field", "entity.id")
q.Set("mincount", "100")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/trends?field=entity.id&mincount=100&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/trends?field=entity.id&mincount=100
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersPaginate through trending sources:
# Page 1
curl -X GET "https://api.apitube.io/v1/news/trends?field=source.id&per_page=10&offset=0&api_key=YOUR_API_KEY"
# Page 2
curl -X GET "https://api.apitube.io/v1/news/trends?field=source.id&per_page=10&offset=10&api_key=YOUR_API_KEY"Find the fastest-growing topics by publication rate:
curl "https://api.apitube.io/v1/news/trends?field=topic.id&sort=growth_rate&order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/trends",
params={
"field": "topic.id",
"sort": "growth_rate",
"order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "field": "topic.id", "sort": "growth_rate", "order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/trends?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["field" => "topic.id", "sort" => "growth_rate", "order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/trends?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/trends")
q := u.Query()
q.Set("field", "topic.id")
q.Set("sort", "growth_rate")
q.Set("order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/trends?field=topic.id&sort=growth_rate&order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/trends?field=topic.id&sort=growth_rate&order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersHourly breakdown of entity mentions:
curl "https://api.apitube.io/v1/news/trends?field=entity.id&time_bucket=hour&published_at.start=NOW-24HOURS&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/trends",
params={
"field": "entity.id",
"time_bucket": "hour",
"published_at.start": "NOW-24HOURS",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "field": "entity.id", "time_bucket": "hour", "published_at.start": "NOW-24HOURS", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/trends?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["field" => "entity.id", "time_bucket" => "hour", "published_at.start" => "NOW-24HOURS", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/trends?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/trends")
q := u.Query()
q.Set("field", "entity.id")
q.Set("time_bucket", "hour")
q.Set("published_at.start", "NOW-24HOURS")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/trends?field=entity.id&time_bucket=hour&published_at.start=NOW-24HOURS&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/trends?field=entity.id&time_bucket=hour&published_at.start=NOW-24HOURS
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Categories
Get articles with a specific category.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
category.id | The category ID of the articles. Supports up to 3 categories simultaneously, separated by commas (OR logic). | string | No | 314 |
ignore.category.id | The category ID of the articles to ignore. Supports up to 3 categories simultaneously, separated by commas (OR logic). | string | No | 315 |
List of supported categories taxonomy
| Taxonomy | Description |
|---|---|
iptc | IPTC |
Workflow examples
Request to get news articles from a specific category (e.g., "Sport"):
This request retrieves news articles that fall under the "sport" category.
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:15000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"category.id": "medtop:15000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "category.id": "medtop:15000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["category.id" => "medtop:15000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("category.id", "medtop:15000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?category.id=medtop:15000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?category.id=medtop:15000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for Articles in the Finance Category:
This request retrieves news articles in the "finance" category.
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"category.id": "medtop:04000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "category.id": "medtop:04000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["category.id" => "medtop:04000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("category.id", "medtop:04000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?category.id=medtop:04000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for Articles in a Category and Filtered by Language:
This request retrieves news articles in the "politics" category that are in French.
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:11000000&language.code=fr&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"category.id": "medtop:11000000",
"language.code": "fr",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "category.id": "medtop:11000000", "language.code": "fr", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["category.id" => "medtop:11000000", "language.code" => "fr", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("category.id", "medtop:11000000")
q.Set("language.code", "fr")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?category.id=medtop:11000000&language.code=fr&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?category.id=medtop:11000000&language.code=fr
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCategory Time-Series Analysis:
This request enables time-series analysis of articles in the "finance" category over a specific time period.
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&published_at.start=NOW-30DAY&sort.by=published_at&sort.order=asc&per_page=100&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"category.id": "medtop:04000000",
"published_at.start": "NOW-30DAY",
"sort.by": "published_at",
"sort.order": "asc",
"per_page": "100",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "category.id": "medtop:04000000", "published_at.start": "NOW-30DAY", "sort.by": "published_at", "sort.order": "asc", "per_page": "100", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["category.id" => "medtop:04000000", "published_at.start" => "NOW-30DAY", "sort.by" => "published_at", "sort.order" => "asc", "per_page" => "100", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("category.id", "medtop:04000000")
q.Set("published_at.start", "NOW-30DAY")
q.Set("sort.by", "published_at")
q.Set("sort.order", "asc")
q.Set("per_page", "100")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&published_at.start=NOW-30DAY&sort.by=published_at&sort.order=asc&per_page=100&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&published_at.start=NOW-30DAY&sort.by=published_at&sort.order=asc&per_page=100
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCategory-Based Media Analysis:
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:01000000&media.images.count=3&source.rank.opr.min=0.6&sort.by=media.images.count&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"category.id": "medtop:01000000",
"media.images.count": "3",
"source.rank.opr.min": "0.6",
"sort.by": "media.images.count",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "category.id": "medtop:01000000", "media.images.count": "3", "source.rank.opr.min": "0.6", "sort.by": "media.images.count", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["category.id" => "medtop:01000000", "media.images.count" => "3", "source.rank.opr.min" => "0.6", "sort.by" => "media.images.count", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("category.id", "medtop:01000000")
q.Set("media.images.count", "3")
q.Set("source.rank.opr.min", "0.6")
q.Set("sort.by", "media.images.count")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?category.id=medtop:01000000&media.images.count=3&source.rank.opr.min=0.6&sort.by=media.images.count&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?category.id=medtop:01000000&media.images.count=3&source.rank.opr.min=0.6&sort.by=media.images.count&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCross-Category Sentiment Comparison:
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:20000003,medtop:11000000,medtop:20000607&sentiment.overall.polarity=positive&sort.by=category.id&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"category.id": "medtop:20000003,medtop:11000000,medtop:20000607",
"sentiment.overall.polarity": "positive",
"sort.by": "category.id",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "category.id": "medtop:20000003,medtop:11000000,medtop:20000607", "sentiment.overall.polarity": "positive", "sort.by": "category.id", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["category.id" => "medtop:20000003,medtop:11000000,medtop:20000607", "sentiment.overall.polarity" => "positive", "sort.by" => "category.id", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("category.id", "medtop:20000003,medtop:11000000,medtop:20000607")
q.Set("sentiment.overall.polarity", "positive")
q.Set("sort.by", "category.id")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?category.id=medtop:20000003,medtop:11000000,medtop:20000607&sentiment.overall.polarity=positive&sort.by=category.id&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?category.id=medtop:20000003,medtop:11000000,medtop:20000607&sentiment.overall.polarity=positive&sort.by=category.id
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Topics
Get articles with a specific topic.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
topic.id | The topic ID of the articles. Supports up to 3 topics simultaneously, separated by commas (OR logic). | integer | No | 1 |
ignore.topic.id | The topic ID of the articles to ignore. Supports up to 3 topics simultaneously, separated by commas (OR logic). | integer | No | 2 |
Workflow examples
Request to get news articles from a specific topic (e.g., "crypto_news"):
This request retrieves news articles that fall under the "crypto news" topic.
curl "https://api.apitube.io/v1/news/everything?topic.id=industry.crypto_news&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"topic.id": "industry.crypto_news",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "topic.id": "industry.crypto_news", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["topic.id" => "industry.crypto_news", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("topic.id", "industry.crypto_news")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?topic.id=industry.crypto_news&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?topic.id=industry.crypto_news
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMulti-Topic Sentiment Analysis:
This request analyzes sentiment across multiple related topics.
curl "https://api.apitube.io/v1/news/everything?topic.id=industry.green_energy_news,industry.energy_news&sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"topic.id": "industry.green_energy_news,industry.energy_news",
"sentiment.overall.polarity": "positive",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "topic.id": "industry.green_energy_news,industry.energy_news", "sentiment.overall.polarity": "positive", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["topic.id" => "industry.green_energy_news,industry.energy_news", "sentiment.overall.polarity" => "positive", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("topic.id", "industry.green_energy_news,industry.energy_news")
q.Set("sentiment.overall.polarity", "positive")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?topic.id=industry.green_energy_news,industry.energy_news&sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?topic.id=industry.green_energy_news,industry.energy_news&sentiment.overall.polarity=positive
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersComparative Topic Analysis with Language Filtering:
This request compares coverage of different topics across specific languages.
curl "https://api.apitube.io/v1/news/everything?topic.id=industry.ai_news&language.code=en,de,ja&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"topic.id": "industry.ai_news",
"language.code": "en,de,ja",
"sort.by": "published_at",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "topic.id": "industry.ai_news", "language.code": "en,de,ja", "sort.by": "published_at", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["topic.id" => "industry.ai_news", "language.code" => "en,de,ja", "sort.by" => "published_at", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("topic.id", "industry.ai_news")
q.Set("language.code", "en,de,ja")
q.Set("sort.by", "published_at")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?topic.id=industry.ai_news&language.code=en,de,ja&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?topic.id=industry.ai_news&language.code=en,de,ja&sort.by=published_at&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersTopic and Entity Intersection Analysis:
curl "https://api.apitube.io/v1/news/everything?topic.id=industry.crypto_news&entity.id=326,327&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"topic.id": "industry.crypto_news",
"entity.id": "326,327",
"sort.by": "published_at",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "topic.id": "industry.crypto_news", "entity.id": "326,327", "sort.by": "published_at", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["topic.id" => "industry.crypto_news", "entity.id" => "326,327", "sort.by" => "published_at", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("topic.id", "industry.crypto_news")
q.Set("entity.id", "326,327")
q.Set("sort.by", "published_at")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?topic.id=industry.crypto_news&entity.id=326,327&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?topic.id=industry.crypto_news&entity.id=326,327&sort.by=published_at&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersTopic-Based Expert Opinion Tracking:
curl "https://api.apitube.io/v1/news/everything?topic.id=industry.technology_news&language.code=en&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"topic.id": "industry.technology_news",
"language.code": "en",
"sort.by": "published_at",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "topic.id": "industry.technology_news", "language.code": "en", "sort.by": "published_at", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["topic.id" => "industry.technology_news", "language.code" => "en", "sort.by" => "published_at", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("topic.id", "industry.technology_news")
q.Set("language.code", "en")
q.Set("sort.by", "published_at")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?topic.id=industry.technology_news&language.code=en&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?topic.id=industry.technology_news&language.code=en&sort.by=published_at&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Industries
Get articles with a specific industry.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
industry.id | The industry ID of the articles. Supports up to 3 industries simultaneously, separated by commas (OR logic). | string | No | 400 |
ignore.industry.id | The industry ID of the articles to ignore. Supports up to 3 industries simultaneously, separated by commas (OR logic). | string | No | 438 |
Industry Sector Performance Tracking:
curl "https://api.apitube.io/v1/news/everything?industry.id=400,438&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"industry.id": "400,438",
"sort.by": "published_at",
"sort.order": "asc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "industry.id": "400,438", "sort.by": "published_at", "sort.order": "asc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["industry.id" => "400,438", "sort.by" => "published_at", "sort.order" => "asc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("industry.id", "400,438")
q.Set("sort.by", "published_at")
q.Set("sort.order", "asc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?industry.id=400,438&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?industry.id=400,438&sort.by=published_at&sort.order=asc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCross-Industry Innovation Analysis:
curl "https://api.apitube.io/v1/news/everything?industry.id=400,438&title=innovation&sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"industry.id": "400,438",
"title": "innovation",
"sentiment.overall.polarity": "positive",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "industry.id": "400,438", "title": "innovation", "sentiment.overall.polarity": "positive", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["industry.id" => "400,438", "title" => "innovation", "sentiment.overall.polarity" => "positive", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("industry.id", "400,438")
q.Set("title", "innovation")
q.Set("sentiment.overall.polarity", "positive")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?industry.id=400,438&title=innovation&sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?industry.id=400,438&title=innovation&sentiment.overall.polarity=positive
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Entities
Get articles with a specific entity.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
entity.id | The entity ID of the articles. Supports up to 3 entities simultaneously, separated by commas (OR logic). | string | No | 314 |
ignore.entity.id | The entity ID of the articles to ignore. Supports up to 3 entities simultaneously, separated by commas (OR logic). | string | No | 315 |
Workflow examples
Request to get news articles about a specific entity (e.g., "Brad Pitt"):
curl "https://api.apitube.io/v1/news/everything?entity.id=1278268&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"entity.id": "1278268",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1278268", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["entity.id" => "1278268", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("entity.id", "1278268")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?entity.id=1278268&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?entity.id=1278268
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about multiple entities (e.g., "Brad Pitt" and "Angelina Jolie"):
curl "https://api.apitube.io/v1/news/everything?entity.id=1278268,1282301&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"entity.id": "1278268,1282301",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1278268,1282301", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["entity.id" => "1278268,1282301", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("entity.id", "1278268,1282301")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?entity.id=1278268,1282301&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?entity.id=1278268,1282301
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about an entity while ignoring another:
curl "https://api.apitube.io/v1/news/everything?entity.id=1278268&ignore.entity.id=315&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"entity.id": "1278268",
"ignore.entity.id": "315",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1278268", "ignore.entity.id": "315", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["entity.id" => "1278268", "ignore.entity.id" => "315", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("entity.id", "1278268")
q.Set("ignore.entity.id", "315")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?entity.id=1278268&ignore.entity.id=315&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?entity.id=1278268&ignore.entity.id=315
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersEntity Correlation Analysis:
curl "https://api.apitube.io/v1/news/everything?entity.id=1278268,1282301&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"entity.id": "1278268,1282301",
"sort.by": "sentiment.overall.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1278268,1282301", "sort.by": "sentiment.overall.score", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["entity.id" => "1278268,1282301", "sort.by" => "sentiment.overall.score", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("entity.id", "1278268,1282301")
q.Set("sort.by", "sentiment.overall.score")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?entity.id=1278268,1282301&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?entity.id=1278268,1282301&sort.by=sentiment.overall.score&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersEntity Mention Tracking Over Time:
curl "https://api.apitube.io/v1/news/everything?entity.id=1278268&per_page=100&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"entity.id": "1278268",
"per_page": "100",
"sort.by": "published_at",
"sort.order": "asc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1278268", "per_page": "100", "sort.by": "published_at", "sort.order": "asc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["entity.id" => "1278268", "per_page" => "100", "sort.by" => "published_at", "sort.order" => "asc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("entity.id", "1278268")
q.Set("per_page", "100")
q.Set("sort.by", "published_at")
q.Set("sort.order", "asc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?entity.id=1278268&per_page=100&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?entity.id=1278268&per_page=100&sort.by=published_at&sort.order=asc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersEntity Co-occurrence Network Analysis:
curl "https://api.apitube.io/v1/news/everything?entity.id=1278268&sort.by=published_at&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"entity.id": "1278268",
"sort.by": "published_at",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1278268", "sort.by": "published_at", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["entity.id" => "1278268", "sort.by" => "published_at", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("entity.id", "1278268")
q.Set("sort.by", "published_at")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?entity.id=1278268&sort.by=published_at&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?entity.id=1278268&sort.by=published_at
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersEntity Impact on Market Sentiment:
curl "https://api.apitube.io/v1/news/everything?entity.id=1278268,1282301&category.id=medtop:04000000&sentiment.overall.score.min=0.7&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"entity.id": "1278268,1282301",
"category.id": "medtop:04000000",
"sentiment.overall.score.min": "0.7",
"sort.by": "sentiment.overall.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1278268,1282301", "category.id": "medtop:04000000", "sentiment.overall.score.min": "0.7", "sort.by": "sentiment.overall.score", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["entity.id" => "1278268,1282301", "category.id" => "medtop:04000000", "sentiment.overall.score.min" => "0.7", "sort.by" => "sentiment.overall.score", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("entity.id", "1278268,1282301")
q.Set("category.id", "medtop:04000000")
q.Set("sentiment.overall.score.min", "0.7")
q.Set("sort.by", "sentiment.overall.score")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?entity.id=1278268,1282301&category.id=medtop:04000000&sentiment.overall.score.min=0.7&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?entity.id=1278268,1282301&category.id=medtop:04000000&sentiment.overall.score.min=0.7&sort.by=sentiment.overall.score&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Persons
Get articles with a specific person.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
person.name | The person name of the articles. Supports up to 3 persons simultaneously, separated by commas (OR logic). | string | No | Elon Musk |
ignore.person.name | The person name of the articles to ignore. Supports up to 3 persons simultaneously, separated by commas (OR logic). | string | No | Donald Trump |
Workflow examples
Request to get news articles about a specific person (e.g., "Elon Musk"):
curl "https://api.apitube.io/v1/news/everything?person.name=Elon Musk&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"person.name": "Elon Musk",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "person.name": "Elon Musk", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["person.name" => "Elon Musk", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("person.name", "Elon Musk")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?person.name=Elon Musk&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?person.name=Elon Musk
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about multiple people (e.g., "Elon Musk" and "Donald Trump"):
curl "https://api.apitube.io/v1/news/everything?person.name=Elon Musk,Donald Trump&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"person.name": "Elon Musk,Donald Trump",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "person.name": "Elon Musk,Donald Trump", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["person.name" => "Elon Musk,Donald Trump", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("person.name", "Elon Musk,Donald Trump")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?person.name=Elon Musk,Donald Trump&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?person.name=Elon Musk,Donald Trump
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersPerson Sentiment Analysis Across Sources:
curl "https://api.apitube.io/v1/news/everything?person.name=Elon Musk&source.domain=theguardian.com,foxnews.com,nytimes.com&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"person.name": "Elon Musk",
"source.domain": "theguardian.com,foxnews.com,nytimes.com",
"sort.by": "sentiment.overall.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "person.name": "Elon Musk", "source.domain": "theguardian.com,foxnews.com,nytimes.com", "sort.by": "sentiment.overall.score", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["person.name" => "Elon Musk", "source.domain" => "theguardian.com,foxnews.com,nytimes.com", "sort.by" => "sentiment.overall.score", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("person.name", "Elon Musk")
q.Set("source.domain", "theguardian.com,foxnews.com,nytimes.com")
q.Set("sort.by", "sentiment.overall.score")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?person.name=Elon Musk&source.domain=theguardian.com,foxnews.com,nytimes.com&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?person.name=Elon Musk&source.domain=theguardian.com,foxnews.com,nytimes.com&sort.by=sentiment.overall.score&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCross-reference Person with Organizations:
curl "https://api.apitube.io/v1/news/everything?person.name=Elon Musk&organization.name=Tesla&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"person.name": "Elon Musk",
"organization.name": "Tesla",
"sort.by": "published_at",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "person.name": "Elon Musk", "organization.name": "Tesla", "sort.by": "published_at", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["person.name" => "Elon Musk", "organization.name" => "Tesla", "sort.by" => "published_at", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("person.name", "Elon Musk")
q.Set("organization.name", "Tesla")
q.Set("sort.by", "published_at")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?person.name=Elon Musk&organization.name=Tesla&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?person.name=Elon Musk&organization.name=Tesla&sort.by=published_at&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersPublic Figure Controversy Timeline:
curl "https://api.apitube.io/v1/news/everything?person.name=Elon Musk&sentiment.overall.polarity=negative&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"person.name": "Elon Musk",
"sentiment.overall.polarity": "negative",
"sort.by": "published_at",
"sort.order": "asc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "person.name": "Elon Musk", "sentiment.overall.polarity": "negative", "sort.by": "published_at", "sort.order": "asc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["person.name" => "Elon Musk", "sentiment.overall.polarity" => "negative", "sort.by" => "published_at", "sort.order" => "asc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("person.name", "Elon Musk")
q.Set("sentiment.overall.polarity", "negative")
q.Set("sort.by", "published_at")
q.Set("sort.order", "asc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?person.name=Elon Musk&sentiment.overall.polarity=negative&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?person.name=Elon Musk&sentiment.overall.polarity=negative&sort.by=published_at&sort.order=asc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersPerson Mention in Research Publications:
curl "https://api.apitube.io/v1/news/everything?person.name=Stephen Hawking&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"person.name": "Stephen Hawking",
"sort.by": "published_at",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "person.name": "Stephen Hawking", "sort.by": "published_at", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["person.name" => "Stephen Hawking", "sort.by" => "published_at", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("person.name", "Stephen Hawking")
q.Set("sort.by", "published_at")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?person.name=Stephen Hawking&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?person.name=Stephen Hawking&sort.by=published_at&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Locations
Get articles from a specific location by name or geographic coordinates.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
By location name
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
location.name | The location name of the articles. Supports up to 3 locations simultaneously, separated by commas (OR logic). | string | No | Tokyo |
ignore.location.name | The location name of the articles to ignore. Supports up to 3 locations simultaneously, separated by commas (OR logic). | string | No | New York |
By geo-coordinates
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
location.lat | Latitude coordinate of the search center. Range: -90 to 90. | float | Yes* | 52.52 |
location.lng | Longitude coordinate of the search center. Range: -180 to 180. | float | Yes* | 13.40 |
location.radius | Search radius in kilometers. Max: 500 km. | integer | Yes* | 50 |
location.radius.min | Minimum search radius in kilometers for ring search. Use with location.radius or alone. | integer | No | 100 |
location.radius | Maximum search radius in kilometers. Use with location.radius.min for ring-shaped search. | integer | No | 500 |
* location.lat, location.lng, and either location.radius or location.radius are required when using geolocation search.
By bounding box
Search for articles within a rectangular geographic area defined by coordinates.
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
location.bbox | Bounding box coordinates. Format: minLat,maxLat,minLng,maxLng | string | No | 40.0,45.0,-74.0,-73.0 |
Bounding Box Format:
minLat- Minimum latitude (southern boundary)maxLat- Maximum latitude (northern boundary)minLng- Minimum longitude (western boundary)maxLng- Maximum longitude (eastern boundary)
By geolocation presence
Filter articles based on whether they have geographic coordinates attached.
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
has_location_geo | Filter by presence of coordinates. 1 = with coordinates only, 0 = without coordinates only | integer | No | 1 |
Usage:
has_location_geo=1- Return only articles that have geographic coordinateshas_location_geo=0- Return only articles without geographic coordinates
Workflow examples
Request to get news articles from a specific location (e.g., "Tokyo"):
curl "https://api.apitube.io/v1/news/everything?location.name=Tokyo&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.name": "Tokyo",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.name": "Tokyo", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.name" => "Tokyo", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.name", "Tokyo")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.name=Tokyo&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.name=Tokyo
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles from multiple locations (e.g., "London" and "Paris"):
curl "https://api.apitube.io/v1/news/everything?location.name=London,Paris&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.name": "London,Paris",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.name": "London,Paris", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.name" => "London,Paris", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.name", "London,Paris")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.name=London,Paris&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.name=London,Paris
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles from a specific location and in a specific language (e.g., "London" and "English") and ignore articles from "Ontario":
curl "https://api.apitube.io/v1/news/everything?location.name=London&language.code=en&ignore.location.name=Ontario&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.name": "London",
"language.code": "en",
"ignore.location.name": "Ontario",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.name": "London", "language.code": "en", "ignore.location.name": "Ontario", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.name" => "London", "language.code" => "en", "ignore.location.name" => "Ontario", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.name", "London")
q.Set("language.code", "en")
q.Set("ignore.location.name", "Ontario")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.name=London&language.code=en&ignore.location.name=Ontario&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.name=London&language.code=en&ignore.location.name=Ontario
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersSearch for news within 50 km of Berlin (geo-coordinates):
curl "https://api.apitube.io/v1/news/everything?location.lat=52.52&location.lng=13.40&location.radius=50&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.lat": "52.52",
"location.lng": "13.40",
"location.radius": "50",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.lat": "52.52", "location.lng": "13.40", "location.radius": "50", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.lat" => "52.52", "location.lng" => "13.40", "location.radius" => "50", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.lat", "52.52")
q.Set("location.lng", "13.40")
q.Set("location.radius", "50")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.lat=52.52&location.lng=13.40&location.radius=50&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.lat=52.52&location.lng=13.40&location.radius=50
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersLocal news with positive sentiment (geo-coordinates):
curl "https://api.apitube.io/v1/news/everything?location.lat=40.7128&location.lng=-74.0060&location.radius=25&sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.lat": "40.7128",
"location.lng": "-74.0060",
"location.radius": "25",
"sentiment.overall.polarity": "positive",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.lat": "40.7128", "location.lng": "-74.0060", "location.radius": "25", "sentiment.overall.polarity": "positive", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.lat" => "40.7128", "location.lng" => "-74.0060", "location.radius" => "25", "sentiment.overall.polarity" => "positive", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.lat", "40.7128")
q.Set("location.lng", "-74.0060")
q.Set("location.radius", "25")
q.Set("sentiment.overall.polarity", "positive")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.lat=40.7128&location.lng=-74.0060&location.radius=25&sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.lat=40.7128&location.lng=-74.0060&location.radius=25&sentiment.overall.polarity=positive
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRegional breaking news (geo-coordinates):
curl "https://api.apitube.io/v1/news/everything?location.lat=51.5074&location.lng=-0.1278&location.radius=100&is_breaking=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.lat": "51.5074",
"location.lng": "-0.1278",
"location.radius": "100",
"is_breaking": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.lat": "51.5074", "location.lng": "-0.1278", "location.radius": "100", "is_breaking": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.lat" => "51.5074", "location.lng" => "-0.1278", "location.radius" => "100", "is_breaking" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.lat", "51.5074")
q.Set("location.lng", "-0.1278")
q.Set("location.radius", "100")
q.Set("is_breaking", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.lat=51.5074&location.lng=-0.1278&location.radius=100&is_breaking=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.lat=51.5074&location.lng=-0.1278&location.radius=100&is_breaking=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersGeopolitical Event Analysis:
curl "https://api.apitube.io/v1/news/everything?location.name=France,Italy&category.id=medtop:11000000&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.name": "France,Italy",
"category.id": "medtop:11000000",
"sort.by": "published_at",
"sort.order": "asc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.name": "France,Italy", "category.id": "medtop:11000000", "sort.by": "published_at", "sort.order": "asc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.name" => "France,Italy", "category.id" => "medtop:11000000", "sort.by" => "published_at", "sort.order" => "asc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.name", "France,Italy")
q.Set("category.id", "medtop:11000000")
q.Set("sort.by", "published_at")
q.Set("sort.order", "asc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.name=France,Italy&category.id=medtop:11000000&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.name=France,Italy&category.id=medtop:11000000&sort.by=published_at&sort.order=asc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMulti-Location Business Impact Study:
curl "https://api.apitube.io/v1/news/everything?location.name=London,Berlin,Paris&category.id=medtop:04000000&organization.name=Google,Microsoft,Amazon&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.name": "London,Berlin,Paris",
"category.id": "medtop:04000000",
"organization.name": "Google,Microsoft,Amazon",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.name": "London,Berlin,Paris", "category.id": "medtop:04000000", "organization.name": "Google,Microsoft,Amazon", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.name" => "London,Berlin,Paris", "category.id" => "medtop:04000000", "organization.name" => "Google,Microsoft,Amazon", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.name", "London,Berlin,Paris")
q.Set("category.id", "medtop:04000000")
q.Set("organization.name", "Google,Microsoft,Amazon")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.name=London,Berlin,Paris&category.id=medtop:04000000&organization.name=Google,Microsoft,Amazon&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.name=London,Berlin,Paris&category.id=medtop:04000000&organization.name=Google,Microsoft,Amazon
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersNatural Disaster Coverage Analysis:
curl "https://api.apitube.io/v1/news/everything?location.name=Japan,Israel&title=earthquake&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.name": "Japan,Israel",
"title": "earthquake",
"sort.by": "published_at",
"sort.order": "asc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.name": "Japan,Israel", "title": "earthquake", "sort.by": "published_at", "sort.order": "asc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.name" => "Japan,Israel", "title" => "earthquake", "sort.by" => "published_at", "sort.order" => "asc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.name", "Japan,Israel")
q.Set("title", "earthquake")
q.Set("sort.by", "published_at")
q.Set("sort.order", "asc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.name=Japan,Israel&title=earthquake&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.name=Japan,Israel&title=earthquake&sort.by=published_at&sort.order=asc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersTourism Sentiment Analysis by Location:
curl "https://api.apitube.io/v1/news/everything?location.name=London,Paris,Berlin&sentiment.overall.polarity=positive&sort.by=published_at&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.name": "London,Paris,Berlin",
"sentiment.overall.polarity": "positive",
"sort.by": "published_at",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.name": "London,Paris,Berlin", "sentiment.overall.polarity": "positive", "sort.by": "published_at", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.name" => "London,Paris,Berlin", "sentiment.overall.polarity" => "positive", "sort.by" => "published_at", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.name", "London,Paris,Berlin")
q.Set("sentiment.overall.polarity", "positive")
q.Set("sort.by", "published_at")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.name=London,Paris,Berlin&sentiment.overall.polarity=positive&sort.by=published_at&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.name=London,Paris,Berlin&sentiment.overall.polarity=positive&sort.by=published_at
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersSearch within the bounding box (New York City area):
curl "https://api.apitube.io/v1/news/everything?location.bbox=40.4774,40.9176,-74.2591,-73.7004&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.bbox": "40.4774,40.9176,-74.2591,-73.7004",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.bbox": "40.4774,40.9176,-74.2591,-73.7004", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.bbox" => "40.4774,40.9176,-74.2591,-73.7004", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.bbox", "40.4774,40.9176,-74.2591,-73.7004")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.bbox=40.4774,40.9176,-74.2591,-73.7004&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.bbox=40.4774,40.9176,-74.2591,-73.7004
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersBounding box with category filter (tech news in Silicon Valley):
curl "https://api.apitube.io/v1/news/everything?location.bbox=37.0,38.0,-123.0,-121.0&category.id=medtop:13000000&published_at.start=2024-01-01&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.bbox": "37.0,38.0,-123.0,-121.0",
"category.id": "medtop:13000000",
"published_at.start": "2024-01-01",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.bbox": "37.0,38.0,-123.0,-121.0", "category.id": "medtop:13000000", "published_at.start": "2024-01-01", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.bbox" => "37.0,38.0,-123.0,-121.0", "category.id" => "medtop:13000000", "published_at.start" => "2024-01-01", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.bbox", "37.0,38.0,-123.0,-121.0")
q.Set("category.id", "medtop:13000000")
q.Set("published_at.start", "2024-01-01")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.bbox=37.0,38.0,-123.0,-121.0&category.id=medtop:13000000&published_at.start=2024-01-01&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.bbox=37.0,38.0,-123.0,-121.0&category.id=medtop:13000000&published_at.start=2024-01-01
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRing search – articles between 100 km and 500 km from Berlin:
curl "https://api.apitube.io/v1/news/everything?location.lat=52.52&location.lng=13.40&location.radius.min=100&location.radius=500&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.lat": "52.52",
"location.lng": "13.40",
"location.radius.min": "100",
"location.radius": "500",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.lat": "52.52", "location.lng": "13.40", "location.radius.min": "100", "location.radius": "500", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.lat" => "52.52", "location.lng" => "13.40", "location.radius.min" => "100", "location.radius" => "500", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.lat", "52.52")
q.Set("location.lng", "13.40")
q.Set("location.radius.min", "100")
q.Set("location.radius", "500")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.lat=52.52&location.lng=13.40&location.radius.min=100&location.radius=500&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.lat=52.52&location.lng=13.40&location.radius.min=100&location.radius=500
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersExclude center area - articles more than 50km from Paris:
curl "https://api.apitube.io/v1/news/everything?location.lat=48.8566&location.lng=2.3522&location.radius.min=50&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.lat": "48.8566",
"location.lng": "2.3522",
"location.radius.min": "50",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.lat": "48.8566", "location.lng": "2.3522", "location.radius.min": "50", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.lat" => "48.8566", "location.lng" => "2.3522", "location.radius.min" => "50", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.lat", "48.8566")
q.Set("location.lng", "2.3522")
q.Set("location.radius.min", "50")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.lat=48.8566&location.lng=2.3522&location.radius.min=50&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.lat=48.8566&location.lng=2.3522&location.radius.min=50
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersArticles with geographic coordinates only:
curl "https://api.apitube.io/v1/news/everything?has_location_geo=1&category.id=medtop:11000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"has_location_geo": "1",
"category.id": "medtop:11000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "has_location_geo": "1", "category.id": "medtop:11000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["has_location_geo" => "1", "category.id" => "medtop:11000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("has_location_geo", "1")
q.Set("category.id", "medtop:11000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?has_location_geo=1&category.id=medtop:11000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?has_location_geo=1&category.id=medtop:11000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersArticles without coordinates (text-based location only):
curl "https://api.apitube.io/v1/news/everything?has_location_geo=0&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"has_location_geo": "0",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "has_location_geo": "0", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["has_location_geo" => "0", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("has_location_geo", "0")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?has_location_geo=0&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?has_location_geo=0
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRegional disaster tracking with a bounding box:
curl "https://api.apitube.io/v1/news/everything?location.bbox=25.0,35.0,-120.0,-80.0&title=hurricane&published_at.start=2024-06-01&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"location.bbox": "25.0,35.0,-120.0,-80.0",
"title": "hurricane",
"published_at.start": "2024-06-01",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "location.bbox": "25.0,35.0,-120.0,-80.0", "title": "hurricane", "published_at.start": "2024-06-01", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["location.bbox" => "25.0,35.0,-120.0,-80.0", "title" => "hurricane", "published_at.start" => "2024-06-01", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("location.bbox", "25.0,35.0,-120.0,-80.0")
q.Set("title", "hurricane")
q.Set("published_at.start", "2024-06-01")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?location.bbox=25.0,35.0,-120.0,-80.0&title=hurricane&published_at.start=2024-06-01&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?location.bbox=25.0,35.0,-120.0,-80.0&title=hurricane&published_at.start=2024-06-01
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Organizations
Get articles with a specific organization.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
organization.name | The organization name of the articles. Supports up to 3 organizations simultaneously, separated by commas (OR logic). | string | No | Google |
ignore.organization.name | The organization name of the articles to ignore. Supports up to 3 organizations simultaneously, separated by commas (OR logic). | string | No | Apple |
Workflow examples
Request to get news articles about a specific organization (e.g., "Google"):
curl "https://api.apitube.io/v1/news/everything?organization.name=Google&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Google",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Google", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Google", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Google")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Google&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Google
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about multiple organizations (e.g., "Google" and "Apple"):
curl "https://api.apitube.io/v1/news/everything?organization.name=Google,Apple&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Google,Apple",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Google,Apple", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Google,Apple", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Google,Apple")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Google,Apple&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Google,Apple
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about an organization while ignoring another (e.g., "Google" and excluding "Apple"):
curl "https://api.apitube.io/v1/news/everything?organization.name=Google&ignore.organization.name=Apple&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Google",
"ignore.organization.name": "Apple",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Google", "ignore.organization.name": "Apple", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Google", "ignore.organization.name" => "Apple", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Google")
q.Set("ignore.organization.name", "Apple")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Google&ignore.organization.name=Apple&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Google&ignore.organization.name=Apple
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCompetitive Intelligence Analysis:
curl "https://api.apitube.io/v1/news/everything?organization.name=Tesla,Meta,Netflix&category.id=medtop:13000000&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Tesla,Meta,Netflix",
"category.id": "medtop:13000000",
"sort.by": "sentiment.overall.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Tesla,Meta,Netflix", "category.id": "medtop:13000000", "sort.by": "sentiment.overall.score", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Tesla,Meta,Netflix", "category.id" => "medtop:13000000", "sort.by" => "sentiment.overall.score", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Tesla,Meta,Netflix")
q.Set("category.id", "medtop:13000000")
q.Set("sort.by", "sentiment.overall.score")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Tesla,Meta,Netflix&category.id=medtop:13000000&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Tesla,Meta,Netflix&category.id=medtop:13000000&sort.by=sentiment.overall.score&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersOrganization Sentiment Tracking During Financial Events:
curl "https://api.apitube.io/v1/news/everything?organization.name=Google&sort.by=published_at&sort.order=asc&category.id=medtop:04000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Google",
"sort.by": "published_at",
"sort.order": "asc",
"category.id": "medtop:04000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Google", "sort.by": "published_at", "sort.order": "asc", "category.id": "medtop:04000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Google", "sort.by" => "published_at", "sort.order" => "asc", "category.id" => "medtop:04000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Google")
q.Set("sort.by", "published_at")
q.Set("sort.order", "asc")
q.Set("category.id", "medtop:04000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Google&sort.by=published_at&sort.order=asc&category.id=medtop:04000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Google&sort.by=published_at&sort.order=asc&category.id=medtop:04000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCorporate Social Responsibility Coverage:
curl "https://api.apitube.io/v1/news/everything?organization.name=Microsoft,Google,Amazon&title=sustainability,ESG,green&sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Microsoft,Google,Amazon",
"title": "sustainability,ESG,green",
"sentiment.overall.polarity": "positive",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Microsoft,Google,Amazon", "title": "sustainability,ESG,green", "sentiment.overall.polarity": "positive", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Microsoft,Google,Amazon", "title" => "sustainability,ESG,green", "sentiment.overall.polarity" => "positive", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Microsoft,Google,Amazon")
q.Set("title", "sustainability,ESG,green")
q.Set("sentiment.overall.polarity", "positive")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Microsoft,Google,Amazon&title=sustainability,ESG,green&sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Microsoft,Google,Amazon&title=sustainability,ESG,green&sentiment.overall.polarity=positive
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersExecutive Leadership Transition Analysis:
curl "https://api.apitube.io/v1/news/everything?organization.name=Google&title=CEO&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Google",
"title": "CEO",
"sort.by": "published_at",
"sort.order": "asc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Google", "title": "CEO", "sort.by": "published_at", "sort.order": "asc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Google", "title" => "CEO", "sort.by" => "published_at", "sort.order" => "asc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Google")
q.Set("title", "CEO")
q.Set("sort.by", "published_at")
q.Set("sort.order", "asc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Google&title=CEO&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Google&title=CEO&sort.by=published_at&sort.order=asc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Natural Disasters
Get articles mentioning specific disasters.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
disaster.name | The disaster name of the articles. Supports up to 3 disasters simultaneously, separated by commas (OR logic). | string | No | Earthquake |
ignore.disaster.name | The disaster name of the articles to ignore. Supports up to 3 disasters simultaneously, separated by commas (OR logic). | string | No | Flood |
Workflow examples
Request to get news articles about a specific disaster (e.g., "Earthquake"):
curl "https://api.apitube.io/v1/news/everything?disaster.name=earthquake&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"disaster.name": "earthquake",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "disaster.name": "earthquake", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["disaster.name" => "earthquake", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("disaster.name", "earthquake")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?disaster.name=earthquake&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?disaster.name=earthquake
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about multiple disasters (e.g., "Earthquake" and "Tsunami"):
curl "https://api.apitube.io/v1/news/everything?disaster.name=earthquake,tsunami&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"disaster.name": "earthquake,tsunami",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "disaster.name": "earthquake,tsunami", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["disaster.name" => "earthquake,tsunami", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("disaster.name", "earthquake,tsunami")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?disaster.name=earthquake,tsunami&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?disaster.name=earthquake,tsunami
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about a disaster while ignoring another:
curl "https://api.apitube.io/v1/news/everything?disaster.name=hurricane&ignore.disaster.name=tornado&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"disaster.name": "hurricane",
"ignore.disaster.name": "tornado",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "disaster.name": "hurricane", "ignore.disaster.name": "tornado", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["disaster.name" => "hurricane", "ignore.disaster.name" => "tornado", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("disaster.name", "hurricane")
q.Set("ignore.disaster.name", "tornado")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?disaster.name=hurricane&ignore.disaster.name=tornado&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?disaster.name=hurricane&ignore.disaster.name=tornado
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersDisaster Impact Analysis by Region:
curl "https://api.apitube.io/v1/news/everything?disaster.name=earthquake&location.name=Japan&sort.by=published_at&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"disaster.name": "earthquake",
"location.name": "Japan",
"sort.by": "published_at",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "disaster.name": "earthquake", "location.name": "Japan", "sort.by": "published_at", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["disaster.name" => "earthquake", "location.name" => "Japan", "sort.by" => "published_at", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("disaster.name", "earthquake")
q.Set("location.name", "Japan")
q.Set("sort.by", "published_at")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?disaster.name=earthquake&location.name=Japan&sort.by=published_at&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?disaster.name=earthquake&location.name=Japan&sort.by=published_at
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Medical diseases
Get articles mentioning specific diseases.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
disease.name | The disease name of the articles. Supports up to 3 diseases simultaneously, separated by commas (OR logic). | string | No | COVID-19 |
ignore.disease.name | The disease name of the articles to ignore. Supports up to 3 diseases simultaneously, separated by commas (OR logic). | string | No | Flu |
Workflow examples
Request to get news articles about a specific disease (e.g., "COVID-19"):
curl "https://api.apitube.io/v1/news/everything?disease.name=COVID-19&category.id=medtop:07000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"disease.name": "COVID-19",
"category.id": "medtop:07000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "disease.name": "COVID-19", "category.id": "medtop:07000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["disease.name" => "COVID-19", "category.id" => "medtop:07000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("disease.name", "COVID-19")
q.Set("category.id", "medtop:07000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?disease.name=COVID-19&category.id=medtop:07000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?disease.name=COVID-19&category.id=medtop:07000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about multiple diseases:
curl "https://api.apitube.io/v1/news/everything?disease.name=COVID-19,Influenza&category.id=medtop:07000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"disease.name": "COVID-19,Influenza",
"category.id": "medtop:07000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "disease.name": "COVID-19,Influenza", "category.id": "medtop:07000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["disease.name" => "COVID-19,Influenza", "category.id" => "medtop:07000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("disease.name", "COVID-19,Influenza")
q.Set("category.id", "medtop:07000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?disease.name=COVID-19,Influenza&category.id=medtop:07000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?disease.name=COVID-19,Influenza&category.id=medtop:07000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about a disease while ignoring another:
curl "https://api.apitube.io/v1/news/everything?disease.name=malaria&ignore.disease.name=dengue&category.id=medtop:07000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"disease.name": "malaria",
"ignore.disease.name": "dengue",
"category.id": "medtop:07000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "disease.name": "malaria", "ignore.disease.name": "dengue", "category.id": "medtop:07000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["disease.name" => "malaria", "ignore.disease.name" => "dengue", "category.id" => "medtop:07000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("disease.name", "malaria")
q.Set("ignore.disease.name", "dengue")
q.Set("category.id", "medtop:07000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?disease.name=malaria&ignore.disease.name=dengue&category.id=medtop:07000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?disease.name=malaria&ignore.disease.name=dengue&category.id=medtop:07000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersDisease Outbreak Tracking:
curl "https://api.apitube.io/v1/news/everything?disease.name=measles&category.id=medtop:07000000&published_at.start=2024-01-01&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"disease.name": "measles",
"category.id": "medtop:07000000",
"published_at.start": "2024-01-01",
"sort.by": "published_at",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "disease.name": "measles", "category.id": "medtop:07000000", "published_at.start": "2024-01-01", "sort.by": "published_at", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["disease.name" => "measles", "category.id" => "medtop:07000000", "published_at.start" => "2024-01-01", "sort.by" => "published_at", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("disease.name", "measles")
q.Set("category.id", "medtop:07000000")
q.Set("published_at.start", "2024-01-01")
q.Set("sort.by", "published_at")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?disease.name=measles&category.id=medtop:07000000&published_at.start=2024-01-01&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?disease.name=measles&category.id=medtop:07000000&published_at.start=2024-01-01&sort.by=published_at&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Events
Get articles mentioning specific events.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
event.name | The event name of the articles. Supports up to 3 events simultaneously, separated by commas (OR logic). | string | No | Olympics |
ignore.event.name | The event name of the articles to ignore. Supports up to 3 events simultaneously, separated by commas (OR logic). | string | No | Super Bowl |
event.type | Filter by detected event type. Supports up to 5 types, separated by commas (OR logic). See the list of values below. | string | No | ipo |
ignore.event.type | Exclude these event types. Supports up to 5 types, separated by commas. | string | No | layoffs |
event.category | Filter by event category. Values: business, society, environment. | string | No | business |
Event types (event.type)
merger-acquisition, ipo, layoffs, bankruptcy, product-launch, funding-round, earnings, partnership, executive-change, lawsuit, data-breach, recall, expansion, closure, stock-movement, contract-award, spin-off, regulatory-action, election, protest, crime, terrorism, accident, policy-change, scandal, death, award-ceremony, conflict, diplomacy, health-crisis, migration, human-rights, earthquake, hurricane, flood, wildfire, tornado, tsunami, volcanic-eruption, drought, climate-event, pollution, wildlife-event, avalanche
Workflow examples
Request to get news articles about a specific event (e.g., "Olympics"):
curl "https://api.apitube.io/v1/news/everything?event.name=Olympics&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"event.name": "Olympics",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "event.name": "Olympics", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["event.name" => "Olympics", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("event.name", "Olympics")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?event.name=Olympics&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?event.name=Olympics
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about multiple events:
curl "https://api.apitube.io/v1/news/everything?event.name=Olympics,World Cup&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"event.name": "Olympics,World Cup",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "event.name": "Olympics,World Cup", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["event.name" => "Olympics,World Cup", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("event.name", "Olympics,World Cup")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?event.name=Olympics,World Cup&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?event.name=Olympics,World Cup
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about an event while ignoring another:
curl "https://api.apitube.io/v1/news/everything?event.name=Grammy Awards&ignore.event.name=Oscar&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"event.name": "Grammy Awards",
"ignore.event.name": "Oscar",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "event.name": "Grammy Awards", "ignore.event.name": "Oscar", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["event.name" => "Grammy Awards", "ignore.event.name" => "Oscar", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("event.name", "Grammy Awards")
q.Set("ignore.event.name", "Oscar")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?event.name=Grammy Awards&ignore.event.name=Oscar&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?event.name=Grammy Awards&ignore.event.name=Oscar
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersEvent Coverage Sentiment Analysis:
curl "https://api.apitube.io/v1/news/everything?event.name=CES&sentiment.overall.polarity=positive&published_at.start=2024-01-01&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"event.name": "CES",
"sentiment.overall.polarity": "positive",
"published_at.start": "2024-01-01",
"sort.by": "sentiment.overall.score",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "event.name": "CES", "sentiment.overall.polarity": "positive", "published_at.start": "2024-01-01", "sort.by": "sentiment.overall.score", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["event.name" => "CES", "sentiment.overall.polarity" => "positive", "published_at.start" => "2024-01-01", "sort.by" => "sentiment.overall.score", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("event.name", "CES")
q.Set("sentiment.overall.polarity", "positive")
q.Set("published_at.start", "2024-01-01")
q.Set("sort.by", "sentiment.overall.score")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?event.name=CES&sentiment.overall.polarity=positive&published_at.start=2024-01-01&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?event.name=CES&sentiment.overall.polarity=positive&published_at.start=2024-01-01&sort.by=sentiment.overall.score
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Brands
Get articles with a specific brand.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
brand.name | The brand name of the articles. Supports up to 3 brands simultaneously, separated by commas (OR logic). | string | No | Nike |
ignore.brand.name | The brand name of the articles to ignore. Supports up to 3 brands simultaneously, separated by commas (OR logic). | string | No | Adidas |
Workflow examples
Request to get news articles about a specific brand (e.g., "Apple"):
curl "https://api.apitube.io/v1/news/everything?brand.name=Apple&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"brand.name": "Apple",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "brand.name": "Apple", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["brand.name" => "Apple", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("brand.name", "Apple")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?brand.name=Apple&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?brand.name=Apple
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about multiple brands (e.g., "Apple" and "Google"):
curl "https://api.apitube.io/v1/news/everything?brand.name=Apple,Google&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"brand.name": "Apple,Google",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "brand.name": "Apple,Google", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["brand.name" => "Apple,Google", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("brand.name", "Apple,Google")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?brand.name=Apple,Google&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?brand.name=Apple,Google
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about a brand while ignoring another (e.g., "Apple" and excluding "Google"):
curl "https://api.apitube.io/v1/news/everything?brand.name=Apple&ignore.brand.name=Google&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"brand.name": "Apple",
"ignore.brand.name": "Google",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "brand.name": "Apple", "ignore.brand.name": "Google", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["brand.name" => "Apple", "ignore.brand.name" => "Google", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("brand.name", "Apple")
q.Set("ignore.brand.name", "Google")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?brand.name=Apple&ignore.brand.name=Google&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?brand.name=Apple&ignore.brand.name=Google
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersBrand Reputation Analysis Across Markets:
curl "https://api.apitube.io/v1/news/everything?brand.name=Tesla&source.country.code=us,de,gb&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"brand.name": "Tesla",
"source.country.code": "us,de,gb",
"sort.by": "sentiment.overall.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "brand.name": "Tesla", "source.country.code": "us,de,gb", "sort.by": "sentiment.overall.score", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["brand.name" => "Tesla", "source.country.code" => "us,de,gb", "sort.by" => "sentiment.overall.score", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("brand.name", "Tesla")
q.Set("source.country.code", "us,de,gb")
q.Set("sort.by", "sentiment.overall.score")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?brand.name=Tesla&source.country.code=us,de,gb&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?brand.name=Tesla&source.country.code=us,de,gb&sort.by=sentiment.overall.score&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersBrand Sponsorship Impact Analysis:
curl "https://api.apitube.io/v1/news/everything?brand.name=Google,Microsoft,Amazon&title=sponsorship,tournament,championship&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"brand.name": "Google,Microsoft,Amazon",
"title": "sponsorship,tournament,championship",
"sort.by": "sentiment.overall.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "brand.name": "Google,Microsoft,Amazon", "title": "sponsorship,tournament,championship", "sort.by": "sentiment.overall.score", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["brand.name" => "Google,Microsoft,Amazon", "title" => "sponsorship,tournament,championship", "sort.by" => "sentiment.overall.score", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("brand.name", "Google,Microsoft,Amazon")
q.Set("title", "sponsorship,tournament,championship")
q.Set("sort.by", "sentiment.overall.score")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?brand.name=Google,Microsoft,Amazon&title=sponsorship,tournament,championship&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?brand.name=Google,Microsoft,Amazon&title=sponsorship,tournament,championship&sort.by=sentiment.overall.score&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersBrand Crisis Management Tracking:
curl "https://api.apitube.io/v1/news/everything?brand.name=Tesla&title=recall&sentiment.overall.polarity=negative&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"brand.name": "Tesla",
"title": "recall",
"sentiment.overall.polarity": "negative",
"sort.by": "published_at",
"sort.order": "asc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "brand.name": "Tesla", "title": "recall", "sentiment.overall.polarity": "negative", "sort.by": "published_at", "sort.order": "asc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["brand.name" => "Tesla", "title" => "recall", "sentiment.overall.polarity" => "negative", "sort.by" => "published_at", "sort.order" => "asc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("brand.name", "Tesla")
q.Set("title", "recall")
q.Set("sentiment.overall.polarity", "negative")
q.Set("sort.by", "published_at")
q.Set("sort.order", "asc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?brand.name=Tesla&title=recall&sentiment.overall.polarity=negative&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?brand.name=Tesla&title=recall&sentiment.overall.polarity=negative&sort.by=published_at&sort.order=asc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Sports
Get articles mentioning a specific sport.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
sport.name | The sport name of the articles. Supports up to 3 sports simultaneously, separated by commas (OR logic). | string | No | Football |
ignore.sport.name | The sport name of the articles to ignore. Supports up to 3 sports simultaneously, separated by commas (OR logic). | string | No | Cricket |
Workflow examples
Request to get news articles about a specific sport (e.g., "Football"):
curl "https://api.apitube.io/v1/news/everything?sport.name=Football&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sport.name": "Football",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sport.name": "Football", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sport.name" => "Football", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sport.name", "Football")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sport.name=Football&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sport.name=Football
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about multiple sports:
curl "https://api.apitube.io/v1/news/everything?sport.name=Football,Basketball&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sport.name": "Football,Basketball",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sport.name": "Football,Basketball", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sport.name" => "Football,Basketball", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sport.name", "Football,Basketball")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sport.name=Football,Basketball&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sport.name=Football,Basketball
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles about a sport while ignoring another:
curl "https://api.apitube.io/v1/news/everything?sport.name=Football&ignore.sport.name=Cricket&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sport.name": "Football",
"ignore.sport.name": "Cricket",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sport.name": "Football", "ignore.sport.name": "Cricket", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sport.name" => "Football", "ignore.sport.name" => "Cricket", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sport.name", "Football")
q.Set("ignore.sport.name", "Cricket")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sport.name=Football&ignore.sport.name=Cricket&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sport.name=Football&ignore.sport.name=Cricket
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Authors
Get articles with a specific author.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
author.id | The author ID of the articles. Supports up to 3 authors simultaneously, separated by commas (OR logic). | string | No |
ignore.author.id | The author ID of the articles to ignore. Supports up to 3 authors simultaneously, separated by commas (OR logic). | string | No |
author.name | The author name of the articles. Supports up to 3 authors simultaneously, separated by commas (OR logic). | string | No |
ignore.author.name | The author name of the articles to ignore. Supports up to 3 authors simultaneously, separated by commas (OR logic). | string | No |
has_author | Filter articles with or without an attributed author. Use 1 for articles with author, 0 for articles without author. | integer | No |
Workflow examples
Request to get news articles by a specific author (e.g., "AFP"):
curl "https://api.apitube.io/v1/news/everything?author.name=AFP&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"author.name": "AFP",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "author.name": "AFP", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["author.name" => "AFP", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("author.name", "AFP")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?author.name=AFP&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?author.name=AFP
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles by multiple authors (e.g., "AFP" and "Reuters"):
curl "https://api.apitube.io/v1/news/everything?author.name=AFP,Reuters&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"author.name": "AFP,Reuters",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "author.name": "AFP,Reuters", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["author.name" => "AFP,Reuters", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("author.name", "AFP,Reuters")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?author.name=AFP,Reuters&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?author.name=AFP,Reuters
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles by a specific author and in a specific language (e.g., "AFP" and "English"):
curl "https://api.apitube.io/v1/news/everything?author.name=AFP&language.code=en&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"author.name": "AFP",
"language.code": "en",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "author.name": "AFP", "language.code": "en", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["author.name" => "AFP", "language.code" => "en", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("author.name", "AFP")
q.Set("language.code", "en")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?author.name=AFP&language.code=en&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?author.name=AFP&language.code=en
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersAuthor Expertise Analysis:
curl "https://api.apitube.io/v1/news/everything?author.name=Ezra Klein&category.id=medtop:11000000&sort.by=published_at&sort.order=desc&per_page=10&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"author.name": "Ezra Klein",
"category.id": "medtop:11000000",
"sort.by": "published_at",
"sort.order": "desc",
"per_page": "10",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "author.name": "Ezra Klein", "category.id": "medtop:11000000", "sort.by": "published_at", "sort.order": "desc", "per_page": "10", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["author.name" => "Ezra Klein", "category.id" => "medtop:11000000", "sort.by" => "published_at", "sort.order" => "desc", "per_page" => "10", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("author.name", "Ezra Klein")
q.Set("category.id", "medtop:11000000")
q.Set("sort.by", "published_at")
q.Set("sort.order", "desc")
q.Set("per_page", "10")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?author.name=Ezra Klein&category.id=medtop:11000000&sort.by=published_at&sort.order=desc&per_page=10&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?author.name=Ezra Klein&category.id=medtop:11000000&sort.by=published_at&sort.order=desc&per_page=10
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersAuthor Sentiment Bias Analysis:
curl "https://api.apitube.io/v1/news/everything?author.name=AFP,Reuters&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"author.name": "AFP,Reuters",
"sort.by": "sentiment.overall.score",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "author.name": "AFP,Reuters", "sort.by": "sentiment.overall.score", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["author.name" => "AFP,Reuters", "sort.by" => "sentiment.overall.score", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("author.name", "AFP,Reuters")
q.Set("sort.by", "sentiment.overall.score")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?author.name=AFP,Reuters&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?author.name=AFP,Reuters&sort.by=sentiment.overall.score
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersAuthor Topic Evolution Tracking:
curl "https://api.apitube.io/v1/news/everything?author.name=Reuters&sort.by=published_at&sort.order=asc&per_page=100&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"author.name": "Reuters",
"sort.by": "published_at",
"sort.order": "asc",
"per_page": "100",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "author.name": "Reuters", "sort.by": "published_at", "sort.order": "asc", "per_page": "100", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["author.name" => "Reuters", "sort.by" => "published_at", "sort.order" => "asc", "per_page" => "100", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("author.name", "Reuters")
q.Set("sort.by", "published_at")
q.Set("sort.order", "asc")
q.Set("per_page", "100")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?author.name=Reuters&sort.by=published_at&sort.order=asc&per_page=100&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?author.name=Reuters&sort.by=published_at&sort.order=asc&per_page=100
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for articles with attributed authors:
curl "https://api.apitube.io/v1/news/everything?has_author=1&category.id=medtop:04000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"has_author": "1",
"category.id": "medtop:04000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "has_author": "1", "category.id": "medtop:04000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["has_author" => "1", "category.id" => "medtop:04000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("has_author", "1")
q.Set("category.id", "medtop:04000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?has_author=1&category.id=medtop:04000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?has_author=1&category.id=medtop:04000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for articles without authors:
curl "https://api.apitube.io/v1/news/everything?has_author=0&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"has_author": "0",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "has_author": "0", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["has_author" => "0", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("has_author", "0")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?has_author=0&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?has_author=0
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Sentiments
Get articles with a specific sentiment score.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
By sentiment score
You can use the sentiment.overall.score parameter to specify the overall sentiment score of the articles you want to retrieve.
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
sentiment.overall.score | The overall sentiment score of the articles. Range: -1 to 1. | float | No | 0.2 |
sentiment.overall.score.min | The minimum overall sentiment score. Range: -1 to 1. | float | No | 0.5 |
sentiment.overall.score.max | The maximum overall sentiment score. Range: -1 to 1. | float | No | 1.0 |
sentiment.overall.polarity | The overall sentiment polarity. Values: positive, negative, neutral. | string | No | positive |
sentiment.title.score | The title sentiment score of the articles. Range: -1 to 1. | float | No | 0.2 |
sentiment.title.score.min | The minimum title sentiment score. Range: -1 to 1. | float | No | 0.5 |
sentiment.title.score.max | The maximum title sentiment score. Range: -1 to 1. | float | No | 1.0 |
sentiment.title.polarity | The title sentiment polarity. Values: positive, negative, neutral. | string | No | positive |
sentiment.body.score | The body sentiment score of the articles. Range: -1 to 1. | float | No | 0.2 |
sentiment.body.score.min | The minimum body sentiment score. Range: -1 to 1. | float | No | 0.5 |
sentiment.body.score.max | The maximum body sentiment score. Range: -1 to 1. | float | No | 1.0 |
sentiment.body.polarity | The body sentiment polarity. Values: positive, negative, neutral. | string | No | positive |
By sentiment polarity
Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
positive | Retrieve articles with positive sentiment. | string | No |
negative | Retrieve articles with negative sentiment. | string | No |
neutral | Retrieve articles with neutral sentiment. | string | No |
sentiment.mixed | Filter articles with mixed sentiment (title/body differ). | integer | No |
sentiment.consistent | Filter articles with consistent sentiment (title/body match). | integer | No |
is_clickbait | Filter clickbait articles where title polarity differs from body AND title has strong sentiment (|score| > 0.5). Use 1 to find clickbait, 0 for consistent articles. | integer | No |
sentiment_gap.min | Minimum sentiment gap between title and body scores. Range: 0-2. | float | No |
sentiment_gap.max | Maximum sentiment gap between title and body scores. Range: 0-2. | float | No |
By entity-level sentiment
Filter articles by the sentiment expressed toward a specific entity (company, person, organization) mentioned inside the article — not the document's overall tone. Combine with an entity selector (entity.id, organization.name, person.name, etc.) to answer questions like "articles where Tesla is mentioned negatively". Used on its own, it matches articles where any entity carries that sentiment.
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
entity.sentiment.polarity | Sentiment polarity toward the entity. Values: positive, negative, neutral. | string | No | negative |
entity.sentiment.score.min | Minimum sentiment score toward the entity. Range: -1 to 1. | float | No | -1 |
entity.sentiment.score.max | Maximum sentiment score toward the entity. Range: -1 to 1. | float | No | -0.2 |
Workflow example
Retrieve articles where the entity 1300782 (e.g. Tesla) is mentioned negatively:
curl "https://api.apitube.io/v1/news/everything?entity.id=1300782&entity.sentiment.polarity=negative&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"entity.id": "1300782",
"entity.sentiment.polarity": "negative",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1300782", "entity.sentiment.polarity": "negative", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["entity.id" => "1300782", "entity.sentiment.polarity" => "negative", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?{$query}");
echo $response;Workflow examples
Request for Positive Sentiment News:
This request retrieves news articles that have been classified with a positive sentiment.
curl "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sentiment.overall.polarity": "positive",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sentiment.overall.polarity": "positive", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sentiment.overall.polarity" => "positive", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sentiment.overall.polarity", "positive")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for Positive Sentiment News from a Specific Country:
This request fetches news articles with positive sentiment specifically from Japan
curl "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&source.country.code=jp&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sentiment.overall.polarity": "positive",
"source.country.code": "jp",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sentiment.overall.polarity": "positive", "source.country.code": "jp", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sentiment.overall.polarity" => "positive", "source.country.code" => "jp", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sentiment.overall.polarity", "positive")
q.Set("source.country.code", "jp")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&source.country.code=jp&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&source.country.code=jp
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for Positive Sentiment News in the Last 24 Hours:
This request retrieves news articles with positive sentiment published in the last 24 hours.
curl "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&published_at.start=2024-12-02&published_at.end=2024-12-03&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sentiment.overall.polarity": "positive",
"published_at.start": "2024-12-02",
"published_at.end": "2024-12-03",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sentiment.overall.polarity": "positive", "published_at.start": "2024-12-02", "published_at.end": "2024-12-03", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sentiment.overall.polarity" => "positive", "published_at.start" => "2024-12-02", "published_at.end" => "2024-12-03", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sentiment.overall.polarity", "positive")
q.Set("published_at.start", "2024-12-02")
q.Set("published_at.end", "2024-12-03")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&published_at.start=2024-12-02&published_at.end=2024-12-03&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&published_at.start=2024-12-02&published_at.end=2024-12-03
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for Articles with Positive Sentiment and a Specific Title:
This request retrieves news articles with positive sentiment that have "technology" in their titles.
curl "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&title=technology&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sentiment.overall.polarity": "positive",
"title": "technology",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sentiment.overall.polarity": "positive", "title": "technology", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sentiment.overall.polarity" => "positive", "title" => "technology", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sentiment.overall.polarity", "positive")
q.Set("title", "technology")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&title=technology&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=positive&title=technology
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMulti-dimensional Sentiment Analysis:
curl "https://api.apitube.io/v1/news/everything?sentiment.overall.score.min=0.7&category.id=medtop:04000000&organization.name=Google,Microsoft&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sentiment.overall.score.min": "0.7",
"category.id": "medtop:04000000",
"organization.name": "Google,Microsoft",
"sort.by": "sentiment.overall.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sentiment.overall.score.min": "0.7", "category.id": "medtop:04000000", "organization.name": "Google,Microsoft", "sort.by": "sentiment.overall.score", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sentiment.overall.score.min" => "0.7", "category.id" => "medtop:04000000", "organization.name" => "Google,Microsoft", "sort.by" => "sentiment.overall.score", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sentiment.overall.score.min", "0.7")
q.Set("category.id", "medtop:04000000")
q.Set("organization.name", "Google,Microsoft")
q.Set("sort.by", "sentiment.overall.score")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sentiment.overall.score.min=0.7&category.id=medtop:04000000&organization.name=Google,Microsoft&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sentiment.overall.score.min=0.7&category.id=medtop:04000000&organization.name=Google,Microsoft&sort.by=sentiment.overall.score&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersComparative Sentiment Analysis Across Markets:
curl "https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=negative&source.country.code=us,gb,de&category.id=medtop:07000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sentiment.overall.polarity": "negative",
"source.country.code": "us,gb,de",
"category.id": "medtop:07000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sentiment.overall.polarity": "negative", "source.country.code": "us,gb,de", "category.id": "medtop:07000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sentiment.overall.polarity" => "negative", "source.country.code" => "us,gb,de", "category.id" => "medtop:07000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sentiment.overall.polarity", "negative")
q.Set("source.country.code", "us,gb,de")
q.Set("category.id", "medtop:07000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=negative&source.country.code=us,gb,de&category.id=medtop:07000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sentiment.overall.polarity=negative&source.country.code=us,gb,de&category.id=medtop:07000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersSentiment Divergence Analysis by Source Type:
curl "https://api.apitube.io/v1/news/everything?topic.id=industry.green_energy_news&sentiment.overall.polarity=positive&source.domain=theguardian.com,nytimes.com&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"topic.id": "industry.green_energy_news",
"sentiment.overall.polarity": "positive",
"source.domain": "theguardian.com,nytimes.com",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "topic.id": "industry.green_energy_news", "sentiment.overall.polarity": "positive", "source.domain": "theguardian.com,nytimes.com", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["topic.id" => "industry.green_energy_news", "sentiment.overall.polarity" => "positive", "source.domain" => "theguardian.com,nytimes.com", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("topic.id", "industry.green_energy_news")
q.Set("sentiment.overall.polarity", "positive")
q.Set("source.domain", "theguardian.com,nytimes.com")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?topic.id=industry.green_energy_news&sentiment.overall.polarity=positive&source.domain=theguardian.com,nytimes.com&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?topic.id=industry.green_energy_news&sentiment.overall.polarity=positive&source.domain=theguardian.com,nytimes.com
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersProduct Review Sentiment Analysis:
curl "https://api.apitube.io/v1/news/everything?title=review&organization.name=Apple&sentiment.overall.score.min=-1.0&sentiment.overall.score.max=1.0&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "review",
"organization.name": "Apple",
"sentiment.overall.score.min": "-1.0",
"sentiment.overall.score.max": "1.0",
"sort.by": "sentiment.overall.score",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "review", "organization.name": "Apple", "sentiment.overall.score.min": "-1.0", "sentiment.overall.score.max": "1.0", "sort.by": "sentiment.overall.score", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "review", "organization.name" => "Apple", "sentiment.overall.score.min" => "-1.0", "sentiment.overall.score.max" => "1.0", "sort.by" => "sentiment.overall.score", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "review")
q.Set("organization.name", "Apple")
q.Set("sentiment.overall.score.min", "-1.0")
q.Set("sentiment.overall.score.max", "1.0")
q.Set("sort.by", "sentiment.overall.score")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=review&organization.name=Apple&sentiment.overall.score.min=-1.0&sentiment.overall.score.max=1.0&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=review&organization.name=Apple&sentiment.overall.score.min=-1.0&sentiment.overall.score.max=1.0&sort.by=sentiment.overall.score
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for articles with mixed sentiment:
This request finds articles where the title sentiment differs from body sentiment, useful for detecting clickbait or controversial framing.
curl "https://api.apitube.io/v1/news/everything?sentiment.mixed=1&category.id=medtop:11000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sentiment.mixed": "1",
"category.id": "medtop:11000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sentiment.mixed": "1", "category.id": "medtop:11000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sentiment.mixed" => "1", "category.id" => "medtop:11000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sentiment.mixed", "1")
q.Set("category.id", "medtop:11000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sentiment.mixed=1&category.id=medtop:11000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sentiment.mixed=1&category.id=medtop:11000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for articles with consistent sentiment:
This request finds articles where the title and body sentiment align, indicating more straightforward reporting.
curl "https://api.apitube.io/v1/news/everything?sentiment.consistent=1&has_author=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sentiment.consistent": "1",
"has_author": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sentiment.consistent": "1", "has_author": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sentiment.consistent" => "1", "has_author" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sentiment.consistent", "1")
q.Set("has_author", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sentiment.consistent=1&has_author=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sentiment.consistent=1&has_author=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for clickbait articles:
This request finds articles where the headline is sensationalized – title sentiment differs from body content and has a strong emotional charge.
curl "https://api.apitube.io/v1/news/everything?is_clickbait=1&category.id=medtop:04000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_clickbait": "1",
"category.id": "medtop:04000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_clickbait": "1", "category.id": "medtop:04000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_clickbait" => "1", "category.id" => "medtop:04000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_clickbait", "1")
q.Set("category.id", "medtop:04000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_clickbait=1&category.id=medtop:04000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_clickbait=1&category.id=medtop:04000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for non-clickbait, trustworthy articles:
This request finds articles with consistent headline-to-content sentiment from verified sources.
curl "https://api.apitube.io/v1/news/everything?is_clickbait=0&is_verified_source=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_clickbait": "0",
"is_verified_source": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_clickbait": "0", "is_verified_source": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_clickbait" => "0", "is_verified_source" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_clickbait", "0")
q.Set("is_verified_source", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_clickbait=0&is_verified_source=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_clickbait=0&is_verified_source=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersFilter by sentiment gap – find articles with significant title/body mismatch:
This request finds articles where the sentiment score differs by at least 0.5 between title and body.
curl "https://api.apitube.io/v1/news/everything?sentiment_gap.min=0.5&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sentiment_gap.min": "0.5",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sentiment_gap.min": "0.5", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sentiment_gap.min" => "0.5", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sentiment_gap.min", "0.5")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sentiment_gap.min=0.5&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sentiment_gap.min=0.5
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersFilter by sentiment gap – find editorially consistent articles:
This request finds articles with minimal sentiment difference (gap < 0.2) between title and body.
curl "https://api.apitube.io/v1/news/everything?sentiment_gap.max=0.2&source.rank.opr.min=0.5&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sentiment_gap.max": "0.2",
"source.rank.opr.min": "0.5",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sentiment_gap.max": "0.2", "source.rank.opr.min": "0.5", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sentiment_gap.max" => "0.2", "source.rank.opr.min" => "0.5", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sentiment_gap.max", "0.2")
q.Set("source.rank.opr.min", "0.5")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sentiment_gap.max=0.2&source.rank.opr.min=0.5&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sentiment_gap.max=0.2&source.rank.opr.min=0.5
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCombined clickbait analysis for political news:
This request analyzes clickbait patterns in political coverage.
curl "https://api.apitube.io/v1/news/everything?is_clickbait=1&category.id=medtop:11000000&sentiment_gap.min=0.3&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_clickbait": "1",
"category.id": "medtop:11000000",
"sentiment_gap.min": "0.3",
"sort.by": "sentiment.overall.score",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_clickbait": "1", "category.id": "medtop:11000000", "sentiment_gap.min": "0.3", "sort.by": "sentiment.overall.score", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_clickbait" => "1", "category.id" => "medtop:11000000", "sentiment_gap.min" => "0.3", "sort.by" => "sentiment.overall.score", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_clickbait", "1")
q.Set("category.id", "medtop:11000000")
q.Set("sentiment_gap.min", "0.3")
q.Set("sort.by", "sentiment.overall.score")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_clickbait=1&category.id=medtop:11000000&sentiment_gap.min=0.3&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_clickbait=1&category.id=medtop:11000000&sentiment_gap.min=0.3&sort.by=sentiment.overall.score
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Media
Get articles with a specific media type and size.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
media.images.count | The number of images in the articles. | integer | No | 2 |
media.images.count.min | The minimum number of images in the articles. | integer | No | 1 |
media.images.count.max | The maximum number of images in the articles. | integer | No | 5 |
media.videos.count | The number of videos in the articles. | integer | No | 1 |
media.videos.count.min | The minimum number of videos in the articles. | integer | No | 1 |
media.videos.count.max | The maximum number of videos in the articles. | integer | No | 3 |
media.images.width.min | The minimum width of the images. | integer | No | 200 |
media.images.width.max | The maximum width of the images. | integer | No | 800 |
media.images.height.min | The minimum height of the images. | integer | No | 200 |
media.images.height.max | The maximum height of the images. | integer | No | 800 |
has_image | Filter articles that have at least one image. | integer | No | 1 |
has_video | Filter articles that have at least one video. | integer | No | 1 |
has_hq_images | Filter articles with high-quality images (width >= 1200px). | integer | No | 1 |
is_media_rich | Filter articles with both images and videos. | integer | No | 1 |
is_landscape_media | Filter articles with landscape-oriented images (width > height). | integer | No | 1 |
is_portrait_media | Filter articles with portrait-oriented images (height > width). | integer | No | 1 |
has_multiple_images | Filter articles with 2 or more images. | integer | No | 1 |
has_fullhd_images | Filter articles with Full HD images (width >= 1920px). | integer | No | 1 |
has_4k_images | Filter articles with 4K images (width >= 3840px). | integer | No | 1 |
has_mobile_optimized_images | Filter articles with mobile-optimized images (320-800px). | integer | No | 1 |
is_instagram_ready | Filter articles with Instagram-ready images (1080px+, square/4:5 ratio). | integer | No | 1 |
is_twitter_card_ready | Filter articles with Twitter Card ready images (800px+, landscape). | integer | No | 1 |
has_consistent_image_sizes | Filter articles with consistent image sizes (variance < 200px). | integer | No | 1 |
has_thumbnail | Filter articles with thumbnail images (width <= 300px). | integer | No | 1 |
has_social_share_image | Filter articles with Open Graph compatible images (1200x630px+). | integer | No | 1 |
has_mixed_media | Filter articles with both images and videos. | integer | No | 1 |
Workflow examples
Request to get news articles with a specific number of images and videos:
curl "https://api.apitube.io/v1/news/everything?media.images.count=2&media.videos.count=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"media.images.count": "2",
"media.videos.count": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "media.images.count": "2", "media.videos.count": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["media.images.count" => "2", "media.videos.count" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("media.images.count", "2")
q.Set("media.videos.count", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?media.images.count=2&media.videos.count=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?media.images.count=2&media.videos.count=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles with images of a specific size:
curl "https://api.apitube.io/v1/news/everything?media.images.width.min=200&media.images.width.max=800&media.images.height.min=200&media.images.height.max=800&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"media.images.width.min": "200",
"media.images.width.max": "800",
"media.images.height.min": "200",
"media.images.height.max": "800",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "media.images.width.min": "200", "media.images.width.max": "800", "media.images.height.min": "200", "media.images.height.max": "800", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["media.images.width.min" => "200", "media.images.width.max" => "800", "media.images.height.min" => "200", "media.images.height.max" => "800", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("media.images.width.min", "200")
q.Set("media.images.width.max", "800")
q.Set("media.images.height.min", "200")
q.Set("media.images.height.max", "800")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?media.images.width.min=200&media.images.width.max=800&media.images.height.min=200&media.images.height.max=800&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?media.images.width.min=200&media.images.width.max=800&media.images.height.min=200&media.images.height.max=800
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRich Media Content Curation:
curl "https://api.apitube.io/v1/news/everything?media.images.count=3&media.videos.count=1&category.id=medtop:13000000&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"media.images.count": "3",
"media.videos.count": "1",
"category.id": "medtop:13000000",
"sort.by": "published_at",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "media.images.count": "3", "media.videos.count": "1", "category.id": "medtop:13000000", "sort.by": "published_at", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["media.images.count" => "3", "media.videos.count" => "1", "category.id" => "medtop:13000000", "sort.by" => "published_at", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("media.images.count", "3")
q.Set("media.videos.count", "1")
q.Set("category.id", "medtop:13000000")
q.Set("sort.by", "published_at")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?media.images.count=3&media.videos.count=1&category.id=medtop:13000000&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?media.images.count=3&media.videos.count=1&category.id=medtop:13000000&sort.by=published_at&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersHigh-Quality Visual News Aggregation:
curl "https://api.apitube.io/v1/news/everything?media.images.width.min=1200&media.images.height.min=800&media.images.count=2&sentiment.overall.polarity=positive&category.id=medtop:13000000&source.rank.opr.min=0.6&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"media.images.width.min": "1200",
"media.images.height.min": "800",
"media.images.count": "2",
"sentiment.overall.polarity": "positive",
"category.id": "medtop:13000000",
"source.rank.opr.min": "0.6",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "media.images.width.min": "1200", "media.images.height.min": "800", "media.images.count": "2", "sentiment.overall.polarity": "positive", "category.id": "medtop:13000000", "source.rank.opr.min": "0.6", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["media.images.width.min" => "1200", "media.images.height.min" => "800", "media.images.count" => "2", "sentiment.overall.polarity" => "positive", "category.id" => "medtop:13000000", "source.rank.opr.min" => "0.6", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("media.images.width.min", "1200")
q.Set("media.images.height.min", "800")
q.Set("media.images.count", "2")
q.Set("sentiment.overall.polarity", "positive")
q.Set("category.id", "medtop:13000000")
q.Set("source.rank.opr.min", "0.6")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?media.images.width.min=1200&media.images.height.min=800&media.images.count=2&sentiment.overall.polarity=positive&category.id=medtop:13000000&source.rank.opr.min=0.6&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?media.images.width.min=1200&media.images.height.min=800&media.images.count=2&sentiment.overall.polarity=positive&category.id=medtop:13000000&source.rank.opr.min=0.6
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersVideo Content Analysis for Educational Topics:
curl "https://api.apitube.io/v1/news/everything?media.videos.count=2&title=education,learning,tutorial&sort.by=media.videos.count&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"media.videos.count": "2",
"title": "education,learning,tutorial",
"sort.by": "media.videos.count",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "media.videos.count": "2", "title": "education,learning,tutorial", "sort.by": "media.videos.count", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["media.videos.count" => "2", "title" => "education,learning,tutorial", "sort.by" => "media.videos.count", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("media.videos.count", "2")
q.Set("title", "education,learning,tutorial")
q.Set("sort.by", "media.videos.count")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?media.videos.count=2&title=education,learning,tutorial&sort.by=media.videos.count&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?media.videos.count=2&title=education,learning,tutorial&sort.by=media.videos.count&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for media-rich articles:
curl "https://api.apitube.io/v1/news/everything?is_media_rich=1&category.id=medtop:13000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_media_rich": "1",
"category.id": "medtop:13000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_media_rich": "1", "category.id": "medtop:13000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_media_rich" => "1", "category.id" => "medtop:13000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_media_rich", "1")
q.Set("category.id", "medtop:13000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_media_rich=1&category.id=medtop:13000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_media_rich=1&category.id=medtop:13000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for articles with high-quality images:
curl "https://api.apitube.io/v1/news/everything?has_hq_images=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"has_hq_images": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "has_hq_images": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["has_hq_images" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("has_hq_images", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?has_hq_images=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?has_hq_images=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for multimedia-rich content:
curl "https://api.apitube.io/v1/news/everything?has_image=1&has_video=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"has_image": "1",
"has_video": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "has_image": "1", "has_video": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["has_image" => "1", "has_video" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("has_image", "1")
q.Set("has_video", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?has_image=1&has_video=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?has_image=1&has_video=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for landscape-oriented images (ideal for headers/banners):
curl "https://api.apitube.io/v1/news/everything?is_landscape_media=1&has_fullhd_images=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_landscape_media": "1",
"has_fullhd_images": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_landscape_media": "1", "has_fullhd_images": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_landscape_media" => "1", "has_fullhd_images" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_landscape_media", "1")
q.Set("has_fullhd_images", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_landscape_media=1&has_fullhd_images=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_landscape_media=1&has_fullhd_images=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for portrait-oriented images (ideal for mobile):
curl "https://api.apitube.io/v1/news/everything?is_portrait_media=1&has_mobile_optimized_images=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_portrait_media": "1",
"has_mobile_optimized_images": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_portrait_media": "1", "has_mobile_optimized_images": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_portrait_media" => "1", "has_mobile_optimized_images" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_portrait_media", "1")
q.Set("has_mobile_optimized_images", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_portrait_media=1&has_mobile_optimized_images=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_portrait_media=1&has_mobile_optimized_images=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for Instagram-ready content:
curl "https://api.apitube.io/v1/news/everything?is_instagram_ready=1&category.id=medtop:08000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_instagram_ready": "1",
"category.id": "medtop:08000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_instagram_ready": "1", "category.id": "medtop:08000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_instagram_ready" => "1", "category.id" => "medtop:08000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_instagram_ready", "1")
q.Set("category.id", "medtop:08000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_instagram_ready=1&category.id=medtop:08000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_instagram_ready=1&category.id=medtop:08000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for Twitter Card optimized content:
curl "https://api.apitube.io/v1/news/everything?is_twitter_card_ready=1&has_social_share_image=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_twitter_card_ready": "1",
"has_social_share_image": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_twitter_card_ready": "1", "has_social_share_image": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_twitter_card_ready" => "1", "has_social_share_image" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_twitter_card_ready", "1")
q.Set("has_social_share_image", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_twitter_card_ready=1&has_social_share_image=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_twitter_card_ready=1&has_social_share_image=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for 4K image galleries:
curl "https://api.apitube.io/v1/news/everything?has_4k_images=1&has_multiple_images=1&category.id=medtop:01000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"has_4k_images": "1",
"has_multiple_images": "1",
"category.id": "medtop:01000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "has_4k_images": "1", "has_multiple_images": "1", "category.id": "medtop:01000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["has_4k_images" => "1", "has_multiple_images" => "1", "category.id" => "medtop:01000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("has_4k_images", "1")
q.Set("has_multiple_images", "1")
q.Set("category.id", "medtop:01000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?has_4k_images=1&has_multiple_images=1&category.id=medtop:01000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?has_4k_images=1&has_multiple_images=1&category.id=medtop:01000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for consistent visual content (curated galleries):
curl "https://api.apitube.io/v1/news/everything?has_consistent_image_sizes=1&has_multiple_images=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"has_consistent_image_sizes": "1",
"has_multiple_images": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "has_consistent_image_sizes": "1", "has_multiple_images": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["has_consistent_image_sizes" => "1", "has_multiple_images" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("has_consistent_image_sizes", "1")
q.Set("has_multiple_images", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?has_consistent_image_sizes=1&has_multiple_images=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?has_consistent_image_sizes=1&has_multiple_images=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for mixed media articles (images + videos):
curl "https://api.apitube.io/v1/news/everything?has_mixed_media=1&sort.by=media.images.count&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"has_mixed_media": "1",
"sort.by": "media.images.count",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "has_mixed_media": "1", "sort.by": "media.images.count", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["has_mixed_media" => "1", "sort.by" => "media.images.count", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("has_mixed_media", "1")
q.Set("sort.by", "media.images.count")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?has_mixed_media=1&sort.by=media.images.count&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?has_mixed_media=1&sort.by=media.images.count&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Source
Get articles with a specific source or sources.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
source.id | The source ID of the articles. Supports up to 3 domains simultaneously, separated by commas (OR logic). | int | No | 314 |
ignore.source.id | The source ID of the articles to ignore. Supports up to 3 domains simultaneously, separated by commas (OR logic). | int | No | 315 |
source.domain | The source domain of the articles. Supports up to 3 domains simultaneously, separated by commas (OR logic). | string | No | theguardian.com |
ignore.source.domain | Ignore the source domain of the articles. Supports up to 3 domains simultaneously, separated by commas (OR logic). | string | No | techcrunch.com |
source.country.code | The country code of the articles you want to retrieve. Supports up to 3 country codes simultaneously, separated by commas (OR logic). | string | No | us |
ignore.source.country.code | The country code of the articles you want to exclude. Supports up to 3 country codes simultaneously, separated by commas (OR logic). | string | No | fr |
source.rank.opr.min | The minimum Open Page Rank source rank. Value from 0.1 to 0.9. | string | No | 0.5 |
source.rank.opr.max | The maximum Open Page Rank source rank. Value from 0.1 to 0.9. | string | No | 0.9 |
source.bias | The media bias of the source. Supports up to 3 biases simultaneously, separated by commas (OR logic). | string | No | left,center,right |
ignore.source.bias | The media bias of the source to ignore. Supports up to 3 biases simultaneously, separated by commas (OR logic). | string | No | left,center,right |
is_premium_source | Filter premium sources with OPR >= 0.6. | integer | No | 1 |
is_verified_source | Filter verified sources with OPR >= 0.5 and not duplicates. | integer | No | 1 |
Workflow examples
Request to get news articles from a specific source (e.g., "theguardian.com"):
curl "https://api.apitube.io/v1/news/everything?source.domain=theguardian.com&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"source.domain": "theguardian.com",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "source.domain": "theguardian.com", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["source.domain" => "theguardian.com", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("source.domain", "theguardian.com")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?source.domain=theguardian.com&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?source.domain=theguardian.com
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles from multiple sources (e.g., "theguardian.com" and "nytimes.com"):
curl "https://api.apitube.io/v1/news/everything?source.domain=theguardian.com,nytimes.com&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"source.domain": "theguardian.com,nytimes.com",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "source.domain": "theguardian.com,nytimes.com", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["source.domain" => "theguardian.com,nytimes.com", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("source.domain", "theguardian.com,nytimes.com")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?source.domain=theguardian.com,nytimes.com&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?source.domain=theguardian.com,nytimes.com
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles from a specific source and in a specific language (e.g., "theguardian.com" and "English"):
curl "https://api.apitube.io/v1/news/everything?source.domain=theguardian.com&language.code=en&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"source.domain": "theguardian.com",
"language.code": "en",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "source.domain": "theguardian.com", "language.code": "en", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["source.domain" => "theguardian.com", "language.code" => "en", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("source.domain", "theguardian.com")
q.Set("language.code", "en")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?source.domain=theguardian.com&language.code=en&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?source.domain=theguardian.com&language.code=en
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles with rank between 0.5 and 0.9:
curl "https://api.apitube.io/v1/news/everything?source.rank.opr.min=0.5&source.rank.opr.max=0.9&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"source.rank.opr.min": "0.5",
"source.rank.opr.max": "0.9",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "source.rank.opr.min": "0.5", "source.rank.opr.max": "0.9", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["source.rank.opr.min" => "0.5", "source.rank.opr.max" => "0.9", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("source.rank.opr.min", "0.5")
q.Set("source.rank.opr.max", "0.9")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?source.rank.opr.min=0.5&source.rank.opr.max=0.9&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?source.rank.opr.min=0.5&source.rank.opr.max=0.9
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCross-Regional Media Bias Analysis:
curl "https://api.apitube.io/v1/news/everything?topic.id=industry.green_energy_news&source.country.code=us,gb,de&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"topic.id": "industry.green_energy_news",
"source.country.code": "us,gb,de",
"sort.by": "sentiment.overall.score",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "topic.id": "industry.green_energy_news", "source.country.code": "us,gb,de", "sort.by": "sentiment.overall.score", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["topic.id" => "industry.green_energy_news", "source.country.code" => "us,gb,de", "sort.by" => "sentiment.overall.score", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("topic.id", "industry.green_energy_news")
q.Set("source.country.code", "us,gb,de")
q.Set("sort.by", "sentiment.overall.score")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?topic.id=industry.green_energy_news&source.country.code=us,gb,de&sort.by=sentiment.overall.score&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?topic.id=industry.green_energy_news&source.country.code=us,gb,de&sort.by=sentiment.overall.score
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for premium source articles:
curl "https://api.apitube.io/v1/news/everything?is_premium_source=1&category.id=medtop:04000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_premium_source": "1",
"category.id": "medtop:04000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_premium_source": "1", "category.id": "medtop:04000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_premium_source" => "1", "category.id" => "medtop:04000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_premium_source", "1")
q.Set("category.id", "medtop:04000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_premium_source=1&category.id=medtop:04000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_premium_source=1&category.id=medtop:04000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for verified source articles:
curl "https://api.apitube.io/v1/news/everything?is_verified_source=1&published_at.start=2024-01-01&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_verified_source": "1",
"published_at.start": "2024-01-01",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_verified_source": "1", "published_at.start": "2024-01-01", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_verified_source" => "1", "published_at.start" => "2024-01-01", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_verified_source", "1")
q.Set("published_at.start", "2024-01-01")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_verified_source=1&published_at.start=2024-01-01&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_verified_source=1&published_at.start=2024-01-01
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Datetime
With the News API, you can specify the date range of the articles you want to retrieve. You can use the published_at.start and published_at.end parameters to specify the date range. The date range is inclusive, meaning that the articles published on the start date and the end date are included in the result.
All datetime math functions using AQL format.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
published_at.start | The start date of the date range. | string | No | 2022-03-14 |
published_at.end | The end date of the date range. | string | No | 2025-12-16 |
published_at | The date of the articles you want to retrieve. | string | No | 2025-09-26 |
Date Formats
You can use the following date formats to specify the date range:
| Example | Description |
|---|---|
2025-01-02T15:04:05Z | The date and time in the YYYY-MM-DDTHH:MM:SSZ format. |
2025-01-02 | The date in the YYYY-MM-DD format. |
02-01-2006 | The date in the DD-MM-YYYY format. |
2006-01-02T15:04:05-07:00 | The date and time in the YYYY-MM-DDTHH:MM:SSZ format. |
2006-01-02T15:04:05.000Z | The date and time in the YYYY-MM-DDTHH:MM:SS.MMMZ format. |
Mon, 02 Jan 2006 15:04:05 MST | The date and time in the D, DD MMM YYYY HH:MM:SS Z format. |
2006-01-02T15:04:05-07:00 | The date and time in the YYYY-MM-DDTHH:MM:SSZ format. |
2006-01-02T15:04:05Z07:00 | The date and time in the YYYY-MM-DDTHH:MM:SSZ07:00 format. RFC3339 without the T separator. |
Mon, 02 Jan 2006 15:04:05 -0700 | The date and time in the D, DD MMM YYYY HH:MM:SS Z format. For example, Mon, 02 Jan 2006 15:04:05 -0700. |
Relative Date Formats (Solr-style Date Math)
You can use relative date expressions similar to Apache Solr's DateMath syntax:
| Format | Example | Description |
|---|---|---|
NOW | NOW | Current time |
NOW±<N><UNIT> | NOW+1DAY, NOW-1WEEK | Offset from current time |
NOW/<UNIT> | NOW/DAY, NOW/MONTH | Truncate/round to start of period (UTC) |
NOW±<N><UNIT>/<UNIT> | NOW-1DAY/DAY, NOW+1MONTH/MONTH | Offset + truncation |
<N><UNIT> | 1WEEK, 2MONTHS, 7DAYS | Relative past (without NOW prefix) |
±<N><UNIT> | +1DAY, -2WEEKS | Explicit direction |
<N><alias> | 1w, 2m, 3d, 4h, 5y | Short aliases |
Supported units:
HOUR/HOURS/h— hoursDAY/DAYS/d— daysWEEK/WEEKS/w— weeksMONTH/MONTHS/m— monthsYEAR/YEARS/y— years
Examples:
# Articles from the last 7 days
curl -X GET "https://api.apitube.io/v1/news/everything?published_at.start=NOW-7DAYS&api_key=YOUR_API_KEY"
# Articles from the last week (short syntax)
curl -X GET "https://api.apitube.io/v1/news/everything?published_at.start=1w&api_key=YOUR_API_KEY"
# Articles from the start of today (UTC)
curl -X GET "https://api.apitube.io/v1/news/everything?published_at.start=NOW/DAY&api_key=YOUR_API_KEY"
# Articles from the start of this month
curl -X GET "https://api.apitube.io/v1/news/everything?published_at.start=NOW/MONTH&api_key=YOUR_API_KEY"
# Articles from the start of yesterday
curl -X GET "https://api.apitube.io/v1/news/everything?published_at.start=NOW-1DAY/DAY&published_at.end=NOW/DAY&api_key=YOUR_API_KEY"
# Trends comparison with 1 week window
curl -X GET "https://api.apitube.io/v1/news/trends?field=entity.id&compare=true&compare_window=1w&api_key=YOUR_API_KEY"Workflow examples
Request to get news articles within a specific date range:
curl "https://api.apitube.io/v1/news/everything?published_at.start=2022-01-01&published_at.end=2022-01-31&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"published_at.start": "2022-01-01",
"published_at.end": "2022-01-31",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "published_at.start": "2022-01-01", "published_at.end": "2022-01-31", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["published_at.start" => "2022-01-01", "published_at.end" => "2022-01-31", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("published_at.start", "2022-01-01")
q.Set("published_at.end", "2022-01-31")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?published_at.start=2022-01-01&published_at.end=2022-01-31&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?published_at.start=2022-01-01&published_at.end=2022-01-31
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news using a relative time range:
curl "https://api.apitube.io/v1/news/everything?published_at.start=NOW-7DAYS&published_at.end=NOW&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"published_at.start": "NOW-7DAYS",
"published_at.end": "NOW",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "published_at.start": "NOW-7DAYS", "published_at.end": "NOW", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["published_at.start" => "NOW-7DAYS", "published_at.end" => "NOW", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("published_at.start", "NOW-7DAYS")
q.Set("published_at.end", "NOW")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?published_at.start=NOW-7DAYS&published_at.end=NOW&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?published_at.start=NOW-7DAYS&published_at.end=NOW
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersComplex Date-Range Analysis with Precise Timestamps:
curl "https://api.apitube.io/v1/news/everything?organization.name=Google&published_at.start=2025-03-01T14:00:00Z&published_at.end=2025-03-02T14:00:00Z&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Google",
"published_at.start": "2025-03-01T14:00:00Z",
"published_at.end": "2025-03-02T14:00:00Z",
"sort.by": "published_at",
"sort.order": "asc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Google", "published_at.start": "2025-03-01T14:00:00Z", "published_at.end": "2025-03-02T14:00:00Z", "sort.by": "published_at", "sort.order": "asc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Google", "published_at.start" => "2025-03-01T14:00:00Z", "published_at.end" => "2025-03-02T14:00:00Z", "sort.by" => "published_at", "sort.order" => "asc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Google")
q.Set("published_at.start", "2025-03-01T14:00:00Z")
q.Set("published_at.end", "2025-03-02T14:00:00Z")
q.Set("sort.by", "published_at")
q.Set("sort.order", "asc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Google&published_at.start=2025-03-01T14:00:00Z&published_at.end=2025-03-02T14:00:00Z&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Google&published_at.start=2025-03-01T14:00:00Z&published_at.end=2025-03-02T14:00:00Z&sort.by=published_at&sort.order=asc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Sorting
With the News API, you can sort the articles by the following parameters:
sort.bysort.order
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters for sorting articles (sort.by)
By default, the articles are sorted by the published date in descending order. You can use the sort.by parameter to specify the sorting criteria.
Basic Sorting Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
published_at | Sort by the published date. | string | No |
created_at | Sort by the creation date in the system. | string | No |
new | Sort by recency in the system (alias for created_at). | string | No |
id | Sort by the article ID. | string | No |
source.rank.opr | Sort by the Open Page Rank source rank. | string | No |
read_time | Sort by the article read time in minutes. | string | No |
sentences_count | Sort by the number of sentences. | string | No |
paragraphs_count | Sort by the number of paragraphs. | string | No |
characters_count | Sort by the number of characters. | string | No |
Sentiment Sorting Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
sentiment.overall.score | Sort by the overall sentiment score. | string | No |
sentiment.title.score | Sort by the title sentiment score. | string | No |
sentiment.body.score | Sort by the body sentiment score. | string | No |
Media Sorting Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
media.images.count | Sort by the number of images. | string | No |
media.videos.count | Sort by the number of videos. | string | No |
media.images.width.min | Sort by the minimum image width. | string | No |
media.images.width.max | Sort by the maximum image width. | string | No |
media.images.height.min | Sort by the minimum image height. | string | No |
media.images.height.max | Sort by the maximum image height. | string | No |
media_richness | Sort by total media content (images + videos). | string | No |
Social Shares Sorting Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
shares.facebook.min | Sort by Facebook shares (ascending). | string | No |
shares.facebook.max | Sort by Facebook shares (descending). | string | No |
shares.twitter.min | Sort by Twitter shares (ascending). | string | No |
shares.twitter.max | Sort by Twitter shares (descending). | string | No |
shares.reddit.min | Sort by Reddit shares (ascending). | string | No |
shares.reddit.max | Sort by Reddit shares (descending). | string | No |
Note: Social share scores are aggregated gradually over 2 hours from the article's publication time. Newly published articles will show lower share counts that increase progressively until reaching their full values after 2 hours.
Advanced Composite Sorting Parameters
These parameters use multifactor algorithms to calculate sophisticated scores for different use cases:
| Parameter | Description | Use Case | Max Score |
|---|---|---|---|
relevance | Smart search ranking with query matching and quality signals | Search engines, query-based discovery | Variable |
engagement | Viral potential predictor for social media | Social feeds, trending sections, viral detection | ~139 pts |
quality | Content quality evaluator for editorial curation | Premium content, editorial picks, quality filters | ~80 pts |
controversy | Polarization detector for debate-worthy topics | Discussion forums, hot topics, political analysis | ~115 pts |
trust | Credibility scorer for fact-checking and research | Academic research, fact-checking, news verification | ~95 pts |
Comparison Table
| Metric | relevance | engagement | quality | controversy | trust |
|---|---|---|---|---|---|
| Best for | Search | Social | Editorial | Debates | Facts |
| Considers sentiment | Slight boost | Positive only | Positive only | Intensity | Neutral only |
| Source rank weight | Medium | Low | Medium | None | Very High |
| Timeliness weight | High | Very High | None | Medium | None |
| Media importance | Low | High | Medium | Videos only | None |
Parameters for sorting order (sort.order)
By default, the articles are sorted in descending order. You can use the asc and desc parameters to specify the sorting order.
| Parameter | Description | Type | Required |
|---|---|---|---|
asc | Sort in ascending order. | string | No |
desc | Sort in descending order. | string | No |
Workflow examples
Request to get news articles sorted by the published date in ascending order:
curl "https://api.apitube.io/v1/news/everything?sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sort.by": "published_at",
"sort.order": "asc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sort.by": "published_at", "sort.order": "asc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sort.by" => "published_at", "sort.order" => "asc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sort.by", "published_at")
q.Set("sort.order", "asc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sort.by=published_at&sort.order=asc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get news articles sorted by the overall sentiment magnitude in descending order:
curl "https://api.apitube.io/v1/news/everything?sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sort.by": "sentiment.overall.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sort.by": "sentiment.overall.score", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sort.by" => "sentiment.overall.score", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sort.by", "sentiment.overall.score")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sort.by=sentiment.overall.score&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get the most viral/engaging articles:
curl "https://api.apitube.io/v1/news/everything?sort.by=engagement&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sort.by": "engagement",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sort.by": "engagement", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sort.by" => "engagement", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sort.by", "engagement")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sort.by=engagement&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sort.by=engagement&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get engaging breaking news with media:
curl "https://api.apitube.io/v1/news/everything?is_breaking=1&media.images.count.min=2&sort.by=engagement&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_breaking": "1",
"media.images.count.min": "2",
"sort.by": "engagement",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_breaking": "1", "media.images.count.min": "2", "sort.by": "engagement", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_breaking" => "1", "media.images.count.min" => "2", "sort.by" => "engagement", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_breaking", "1")
q.Set("media.images.count.min", "2")
q.Set("sort.by", "engagement")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_breaking=1&media.images.count.min=2&sort.by=engagement&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_breaking=1&media.images.count.min=2&sort.by=engagement&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get the most media-rich articles:
curl "https://api.apitube.io/v1/news/everything?sort.by=media_richness&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sort.by": "media_richness",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sort.by": "media_richness", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sort.by" => "media_richness", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sort.by", "media_richness")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sort.by=media_richness&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sort.by=media_richness&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get articles from high-ranking sources sorted by source rank:
curl "https://api.apitube.io/v1/news/everything?source.rank.opr.min=0.5&sort.by=source.rank.opr&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"source.rank.opr.min": "0.5",
"sort.by": "source.rank.opr",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "source.rank.opr.min": "0.5", "sort.by": "source.rank.opr", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["source.rank.opr.min" => "0.5", "sort.by" => "source.rank.opr", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("source.rank.opr.min", "0.5")
q.Set("sort.by", "source.rank.opr")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?source.rank.opr.min=0.5&sort.by=source.rank.opr&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?source.rank.opr.min=0.5&sort.by=source.rank.opr&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get quick-read articles sorted by read time:
curl "https://api.apitube.io/v1/news/everything?read_time.max=5&sort.by=read_time&sort.order=asc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"read_time.max": "5",
"sort.by": "read_time",
"sort.order": "asc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "read_time.max": "5", "sort.by": "read_time", "sort.order": "asc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["read_time.max" => "5", "sort.by" => "read_time", "sort.order" => "asc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("read_time.max", "5")
q.Set("sort.by", "read_time")
q.Set("sort.order", "asc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?read_time.max=5&sort.by=read_time&sort.order=asc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?read_time.max=5&sort.by=read_time&sort.order=asc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get high-quality visual content sorted by image dimensions:
curl "https://api.apitube.io/v1/news/everything?media.images.count.min=3&sort.by=media.images.width.max&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"media.images.count.min": "3",
"sort.by": "media.images.width.max",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "media.images.count.min": "3", "sort.by": "media.images.width.max", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["media.images.count.min" => "3", "sort.by" => "media.images.width.max", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("media.images.count.min", "3")
q.Set("sort.by", "media.images.width.max")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?media.images.count.min=3&sort.by=media.images.width.max&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?media.images.count.min=3&sort.by=media.images.width.max&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMulti-dimensional Content Ranking:
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:13000000&source.rank.opr.min=0.6&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"category.id": "medtop:13000000",
"source.rank.opr.min": "0.6",
"sort.by": "sentiment.overall.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "category.id": "medtop:13000000", "source.rank.opr.min": "0.6", "sort.by": "sentiment.overall.score", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["category.id" => "medtop:13000000", "source.rank.opr.min" => "0.6", "sort.by" => "sentiment.overall.score", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("category.id", "medtop:13000000")
q.Set("source.rank.opr.min", "0.6")
q.Set("sort.by", "sentiment.overall.score")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?category.id=medtop:13000000&source.rank.opr.min=0.6&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?category.id=medtop:13000000&source.rank.opr.min=0.6&sort.by=sentiment.overall.score&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMedia-Rich Content Prioritization:
curl "https://api.apitube.io/v1/news/everything?media.images.count=2&media.videos.count=1&sort.by=media.images.count&sort.order=desc&category.id=medtop:13000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"media.images.count": "2",
"media.videos.count": "1",
"sort.by": "media.images.count",
"sort.order": "desc",
"category.id": "medtop:13000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "media.images.count": "2", "media.videos.count": "1", "sort.by": "media.images.count", "sort.order": "desc", "category.id": "medtop:13000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["media.images.count" => "2", "media.videos.count" => "1", "sort.by" => "media.images.count", "sort.order" => "desc", "category.id" => "medtop:13000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("media.images.count", "2")
q.Set("media.videos.count", "1")
q.Set("sort.by", "media.images.count")
q.Set("sort.order", "desc")
q.Set("category.id", "medtop:13000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?media.images.count=2&media.videos.count=1&sort.by=media.images.count&sort.order=desc&category.id=medtop:13000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?media.images.count=2&media.videos.count=1&sort.by=media.images.count&sort.order=desc&category.id=medtop:13000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersIn-Depth Analysis Articles:
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&sort.by=paragraphs_count&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"category.id": "medtop:04000000",
"sort.by": "paragraphs_count",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "category.id": "medtop:04000000", "sort.by": "paragraphs_count", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["category.id" => "medtop:04000000", "sort.by" => "paragraphs_count", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("category.id", "medtop:04000000")
q.Set("sort.by", "paragraphs_count")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&sort.by=paragraphs_count&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&sort.by=paragraphs_count&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersSentiment-Based Content Discovery:
curl "https://api.apitube.io/v1/news/everything?topic.id=industry.ai_news&sort.by=sentiment.title.score&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"topic.id": "industry.ai_news",
"sort.by": "sentiment.title.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "topic.id": "industry.ai_news", "sort.by": "sentiment.title.score", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["topic.id" => "industry.ai_news", "sort.by" => "sentiment.title.score", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("topic.id", "industry.ai_news")
q.Set("sort.by", "sentiment.title.score")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?topic.id=industry.ai_news&sort.by=sentiment.title.score&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?topic.id=industry.ai_news&sort.by=sentiment.title.score&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersHigh-Quality Long-Form Content:
curl "https://api.apitube.io/v1/news/everything?sort.by=quality&sort.order=desc&is_long_read=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sort.by": "quality",
"sort.order": "desc",
"is_long_read": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sort.by": "quality", "sort.order": "desc", "is_long_read": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sort.by" => "quality", "sort.order" => "desc", "is_long_read" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sort.by", "quality")
q.Set("sort.order", "desc")
q.Set("is_long_read", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sort.by=quality&sort.order=desc&is_long_read=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sort.by=quality&sort.order=desc&is_long_read=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersControversial/Polarizing Topics:
curl "https://api.apitube.io/v1/news/everything?sort.by=controversy&sort.order=desc&category.id=medtop:11000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sort.by": "controversy",
"sort.order": "desc",
"category.id": "medtop:11000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sort.by": "controversy", "sort.order": "desc", "category.id": "medtop:11000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sort.by" => "controversy", "sort.order" => "desc", "category.id" => "medtop:11000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sort.by", "controversy")
q.Set("sort.order", "desc")
q.Set("category.id", "medtop:11000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sort.by=controversy&sort.order=desc&category.id=medtop:11000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sort.by=controversy&sort.order=desc&category.id=medtop:11000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMost Trustworthy News Sources:
curl "https://api.apitube.io/v1/news/everything?sort.by=trust&sort.order=desc&published_at.start=2024-01-01&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sort.by": "trust",
"sort.order": "desc",
"published_at.start": "2024-01-01",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sort.by": "trust", "sort.order": "desc", "published_at.start": "2024-01-01", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sort.by" => "trust", "sort.order" => "desc", "published_at.start" => "2024-01-01", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sort.by", "trust")
q.Set("sort.order", "desc")
q.Set("published_at.start", "2024-01-01")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sort.by=trust&sort.order=desc&published_at.start=2024-01-01&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sort.by=trust&sort.order=desc&published_at.start=2024-01-01
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCombining Quality with Editorial Filters:
curl "https://api.apitube.io/v1/news/everything?sort.by=quality&source.rank.opr.min=0.5&is_duplicate=0&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sort.by": "quality",
"source.rank.opr.min": "0.5",
"is_duplicate": "0",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sort.by": "quality", "source.rank.opr.min": "0.5", "is_duplicate": "0", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sort.by" => "quality", "source.rank.opr.min" => "0.5", "is_duplicate" => "0", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sort.by", "quality")
q.Set("source.rank.opr.min", "0.5")
q.Set("is_duplicate", "0")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sort.by=quality&source.rank.opr.min=0.5&is_duplicate=0&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sort.by=quality&source.rank.opr.min=0.5&is_duplicate=0
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersViral Content for Social Media:
curl "https://api.apitube.io/v1/news/everything?sort.by=engagement&published_at.start=2024-01-01&media.images.count.min=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sort.by": "engagement",
"published_at.start": "2024-01-01",
"media.images.count.min": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sort.by": "engagement", "published_at.start": "2024-01-01", "media.images.count.min": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sort.by" => "engagement", "published_at.start" => "2024-01-01", "media.images.count.min" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sort.by", "engagement")
q.Set("published_at.start", "2024-01-01")
q.Set("media.images.count.min", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sort.by=engagement&published_at.start=2024-01-01&media.images.count.min=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sort.by=engagement&published_at.start=2024-01-01&media.images.count.min=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCredible Sources for Research:
curl "https://api.apitube.io/v1/news/everything?sort.by=trust&source.rank.opr.min=0.6&sentiment.overall.polarity=neutral&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"sort.by": "trust",
"source.rank.opr.min": "0.6",
"sentiment.overall.polarity": "neutral",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "sort.by": "trust", "source.rank.opr.min": "0.6", "sentiment.overall.polarity": "neutral", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["sort.by" => "trust", "source.rank.opr.min" => "0.6", "sentiment.overall.polarity" => "neutral", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("sort.by", "trust")
q.Set("source.rank.opr.min", "0.6")
q.Set("sentiment.overall.polarity", "neutral")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?sort.by=trust&source.rank.opr.min=0.6&sentiment.overall.polarity=neutral&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?sort.by=trust&source.rank.opr.min=0.6&sentiment.overall.polarity=neutral
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Field Selection
Select specific fields to return in API responses, reducing payload size and improving performance.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
fl | Comma-separated list of fields to return. Supports nested fields with dot notation (e.g., source.name). | string | No |
Field Notation
- Simple fields:
id,title,body - Nested fields: Use dot notation to access nested properties
source.name- returns only the source namesource.domain- returns only the source domainsentiment.overall.score- returns only the overall sentiment scoremedia.images.count- returns only the image count
Workflow examples
Request to get only ID and title:
curl "https://api.apitube.io/v1/news/everything?fl=id,title&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"fl": "id,title",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "fl": "id,title", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["fl" => "id,title", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("fl", "id,title")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?fl=id,title&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?fl=id,title
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get an article with specific source fields:
curl "https://api.apitube.io/v1/news/everything?fl=id,title,source.name,source.domain,source.rank.opr&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"fl": "id,title,source.name,source.domain,source.rank.opr",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "fl": "id,title,source.name,source.domain,source.rank.opr", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["fl" => "id,title,source.name,source.domain,source.rank.opr", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("fl", "id,title,source.name,source.domain,source.rank.opr")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?fl=id,title,source.name,source.domain,source.rank.opr&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?fl=id,title,source.name,source.domain,source.rank.opr
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get sentiment analysis data only:
curl "https://api.apitube.io/v1/news/everything?fl=id,title,sentiment.overall.score,sentiment.title.score,sentiment.body.score&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"fl": "id,title,sentiment.overall.score,sentiment.title.score,sentiment.body.score",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "fl": "id,title,sentiment.overall.score,sentiment.title.score,sentiment.body.score", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["fl" => "id,title,sentiment.overall.score,sentiment.title.score,sentiment.body.score", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("fl", "id,title,sentiment.overall.score,sentiment.title.score,sentiment.body.score")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?fl=id,title,sentiment.overall.score,sentiment.title.score,sentiment.body.score&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?fl=id,title,sentiment.overall.score,sentiment.title.score,sentiment.body.score
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest to get media information:
curl "https://api.apitube.io/v1/news/everything?fl=id,title,media.images.count,media.videos.count&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"fl": "id,title,media.images.count,media.videos.count",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "fl": "id,title,media.images.count,media.videos.count", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["fl" => "id,title,media.images.count,media.videos.count", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("fl", "id,title,media.images.count,media.videos.count")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?fl=id,title,media.images.count,media.videos.count&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?fl=id,title,media.images.count,media.videos.count
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMinimal response for feed aggregation:
curl "https://api.apitube.io/v1/news/everything?fl=id,title,published_at,source.name,source.domain&category.id=medtop:04000000&per_page=100&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"fl": "id,title,published_at,source.name,source.domain",
"category.id": "medtop:04000000",
"per_page": "100",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "fl": "id,title,published_at,source.name,source.domain", "category.id": "medtop:04000000", "per_page": "100", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["fl" => "id,title,published_at,source.name,source.domain", "category.id" => "medtop:04000000", "per_page" => "100", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("fl", "id,title,published_at,source.name,source.domain")
q.Set("category.id", "medtop:04000000")
q.Set("per_page", "100")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?fl=id,title,published_at,source.name,source.domain&category.id=medtop:04000000&per_page=100&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?fl=id,title,published_at,source.name,source.domain&category.id=medtop:04000000&per_page=100
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersSentiment monitoring with minimal data:
curl "https://api.apitube.io/v1/news/everything?fl=id,title,sentiment.overall.score,sentiment.overall.polarity,published_at&organization.name=Tesla&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"fl": "id,title,sentiment.overall.score,sentiment.overall.polarity,published_at",
"organization.name": "Tesla",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "fl": "id,title,sentiment.overall.score,sentiment.overall.polarity,published_at", "organization.name": "Tesla", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["fl" => "id,title,sentiment.overall.score,sentiment.overall.polarity,published_at", "organization.name" => "Tesla", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("fl", "id,title,sentiment.overall.score,sentiment.overall.polarity,published_at")
q.Set("organization.name", "Tesla")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?fl=id,title,sentiment.overall.score,sentiment.overall.polarity,published_at&organization.name=Tesla&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?fl=id,title,sentiment.overall.score,sentiment.overall.polarity,published_at&organization.name=Tesla
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersLightweight news ticker:
curl "https://api.apitube.io/v1/news/everything?fl=id,title,source.name,published_at&is_breaking=1&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"fl": "id,title,source.name,published_at",
"is_breaking": "1",
"sort.by": "published_at",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "fl": "id,title,source.name,published_at", "is_breaking": "1", "sort.by": "published_at", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["fl" => "id,title,source.name,published_at", "is_breaking" => "1", "sort.by" => "published_at", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("fl", "id,title,source.name,published_at")
q.Set("is_breaking", "1")
q.Set("sort.by", "published_at")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?fl=id,title,source.name,published_at&is_breaking=1&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?fl=id,title,source.name,published_at&is_breaking=1&sort.by=published_at&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersPerformance optimization for large datasets:
curl "https://api.apitube.io/v1/news/everything?fl=id,title,source.domain&per_page=100&published_at.start=2024-01-01&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"fl": "id,title,source.domain",
"per_page": "100",
"published_at.start": "2024-01-01",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "fl": "id,title,source.domain", "per_page": "100", "published_at.start": "2024-01-01", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["fl" => "id,title,source.domain", "per_page" => "100", "published_at.start" => "2024-01-01", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("fl", "id,title,source.domain")
q.Set("per_page", "100")
q.Set("published_at.start", "2024-01-01")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?fl=id,title,source.domain&per_page=100&published_at.start=2024-01-01&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?fl=id,title,source.domain&per_page=100&published_at.start=2024-01-01
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Faceting
Faceting allows you to get aggregated counts of articles grouped by specific fields. This is useful for building filtered navigation, analytics dashboards, and understanding the distribution of your search results.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Default | Required |
|---|---|---|---|---|
facet | Enable faceting. Set to true or 1 to enable. | boolean | false | No |
facet.field | Comma-separated list of fields to facet on. Max 5 fields. | string | - | Yes (when facet=true) |
facet.limit | Maximum number of facet values to return per field. | integer | 10 | No |
facet.mincount | Minimum count for a facet value to be included. | integer | 1 | No |
Supported Facet Fields
Source & Location Fields
| Field | Description |
|---|---|
source.id | Group by source media ID |
source.country.id | Group by source country ID |
source.bias | Group by source media bias (-3 to 3 scale) |
source.rank.opr | Group by source OpenPageRank rating (0.1-0.9) |
Content Classification Fields
| Field | Description |
|---|---|
category.id | Group by category ID |
topic.id | Group by topic ID |
industry.id | Group by industry ID |
Language & Author Fields
| Field | Description |
|---|---|
language.id | Group by language ID |
author.id | Group by author ID |
Sentiment Analysis Fields
| Field | Description |
|---|---|
sentiment.overall.polarity | Group by overall sentiment polarity (-1=negative, 0=neutral, 1=positive) |
sentiment.title.polarity | Group by title sentiment polarity (-1=negative, 0=neutral, 1=positive) |
sentiment.body.polarity | Group by body sentiment polarity (-1=negative, 0=neutral, 1=positive) |
Article Attributes Fields
| Field | Description |
|---|---|
is_duplicate | Group by duplicate status (0=unique, 1=duplicate) |
is_free | Group by paywall status (0=behind paywall, 1=free access) |
is_important | Group by importance/breaking news status (0=regular, 1=breaking/important) |
Media Content Fields
| Field | Description |
|---|---|
media.images.count | Group by number of images in article (0, 1, 2, 3+) |
media.videos.count | Group by number of videos in article (0, 1, 2+) |
Reading Time Fields
| Field | Description |
|---|---|
read_time | Group by estimated reading time in minutes |
Temporal Analysis Fields
| Field | Description |
|---|---|
published.year | Group by publication year (e.g., 2024, 2025) |
published.month | Group by publication year-month (e.g., 202401, 202402) |
published.day_of_week | Group by day of week (1=Monday, 7=Sunday) |
published.hour | Group by hour of day (0-23) |
published.weekday | Group by weekday vs weekend (weekday, weekend) |
published.time_of_day | Group by time of day (morning, afternoon, evening, night) |
Content Analysis Fields
| Field | Description |
|---|---|
content.length | Group by content length (short <3min, medium 3-8min, long >8min read time) |
sentiment.strength | Group by sentiment intensity (strong >0.7, moderate 0.3-0.7, neutral <0.3) |
Entity Fields
| Field | Description |
|---|---|
entity.id | Group by entity ID - useful for finding most mentioned entities |
Response Format
When faceting is enabled, the response includes a facets object:
{
"status": "ok",
"results": [...],
"facets": {
"source.id": [
{"value": 12345, "count": 150},
{"value": 12346, "count": 120},
{"value": 12347, "count": 95}
],
"language.id": [
{"value": 1, "count": 450},
{"value": 2, "count": 120}
]
}
}Workflow examples
Basic faceting by source:
curl "https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.id&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"facet": "true",
"facet.field": "source.id",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "facet": "true", "facet.field": "source.id", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["facet" => "true", "facet.field" => "source.id", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("facet", "true")
q.Set("facet.field", "source.id")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.id&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.id
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersFaceting with multiple fields:
curl "https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.id,language.id,sentiment.overall.polarity&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"facet": "true",
"facet.field": "source.id,language.id,sentiment.overall.polarity",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "facet": "true", "facet.field": "source.id,language.id,sentiment.overall.polarity", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["facet" => "true", "facet.field" => "source.id,language.id,sentiment.overall.polarity", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("facet", "true")
q.Set("facet.field", "source.id,language.id,sentiment.overall.polarity")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.id,language.id,sentiment.overall.polarity&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.id,language.id,sentiment.overall.polarity
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersFaceting with custom limit:
curl "https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.id&facet.limit=20&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"facet": "true",
"facet.field": "source.id",
"facet.limit": "20",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "facet": "true", "facet.field": "source.id", "facet.limit": "20", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["facet" => "true", "facet.field" => "source.id", "facet.limit" => "20", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("facet", "true")
q.Set("facet.field", "source.id")
q.Set("facet.limit", "20")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.id&facet.limit=20&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.id&facet.limit=20
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersFaceting with minimum count filter:
curl "https://api.apitube.io/v1/news/everything?facet=true&facet.field=category.id&facet.mincount=10&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"facet": "true",
"facet.field": "category.id",
"facet.mincount": "10",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "facet": "true", "facet.field": "category.id", "facet.mincount": "10", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["facet" => "true", "facet.field" => "category.id", "facet.mincount" => "10", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("facet", "true")
q.Set("facet.field", "category.id")
q.Set("facet.mincount", "10")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?facet=true&facet.field=category.id&facet.mincount=10&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?facet=true&facet.field=category.id&facet.mincount=10
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersFaceting combined with search filters:
curl "https://api.apitube.io/v1/news/everything?title=bitcoin&facet=true&facet.field=source.id,sentiment.overall.polarity&published_at.start=2024-01-01&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "bitcoin",
"facet": "true",
"facet.field": "source.id,sentiment.overall.polarity",
"published_at.start": "2024-01-01",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "bitcoin", "facet": "true", "facet.field": "source.id,sentiment.overall.polarity", "published_at.start": "2024-01-01", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "bitcoin", "facet" => "true", "facet.field" => "source.id,sentiment.overall.polarity", "published_at.start" => "2024-01-01", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "bitcoin")
q.Set("facet", "true")
q.Set("facet.field", "source.id,sentiment.overall.polarity")
q.Set("published_at.start", "2024-01-01")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=bitcoin&facet=true&facet.field=source.id,sentiment.overall.polarity&published_at.start=2024-01-01&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=bitcoin&facet=true&facet.field=source.id,sentiment.overall.polarity&published_at.start=2024-01-01
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersFaceting for language distribution analysis:
curl "https://api.apitube.io/v1/news/everything?organization.name=Tesla&facet=true&facet.field=language.id,source.country.id&facet.limit=15&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Tesla",
"facet": "true",
"facet.field": "language.id,source.country.id",
"facet.limit": "15",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Tesla", "facet": "true", "facet.field": "language.id,source.country.id", "facet.limit": "15", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Tesla", "facet" => "true", "facet.field" => "language.id,source.country.id", "facet.limit" => "15", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Tesla")
q.Set("facet", "true")
q.Set("facet.field", "language.id,source.country.id")
q.Set("facet.limit", "15")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Tesla&facet=true&facet.field=language.id,source.country.id&facet.limit=15&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Tesla&facet=true&facet.field=language.id,source.country.id&facet.limit=15
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersFaceting for sentiment analysis by source:
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&facet=true&facet.field=source.id,sentiment.overall.polarity&facet.limit=10&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"category.id": "medtop:04000000",
"facet": "true",
"facet.field": "source.id,sentiment.overall.polarity",
"facet.limit": "10",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "category.id": "medtop:04000000", "facet": "true", "facet.field": "source.id,sentiment.overall.polarity", "facet.limit": "10", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["category.id" => "medtop:04000000", "facet" => "true", "facet.field" => "source.id,sentiment.overall.polarity", "facet.limit" => "10", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("category.id", "medtop:04000000")
q.Set("facet", "true")
q.Set("facet.field", "source.id,sentiment.overall.polarity")
q.Set("facet.limit", "10")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&facet=true&facet.field=source.id,sentiment.overall.polarity&facet.limit=10&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&facet=true&facet.field=source.id,sentiment.overall.polarity&facet.limit=10
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersFaceting for media bias distribution:
curl "https://api.apitube.io/v1/news/everything?topic.id=industry.green_energy_news&facet=true&facet.field=source.bias,source.country.id&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"topic.id": "industry.green_energy_news",
"facet": "true",
"facet.field": "source.bias,source.country.id",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "topic.id": "industry.green_energy_news", "facet": "true", "facet.field": "source.bias,source.country.id", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["topic.id" => "industry.green_energy_news", "facet" => "true", "facet.field" => "source.bias,source.country.id", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("topic.id", "industry.green_energy_news")
q.Set("facet", "true")
q.Set("facet.field", "source.bias,source.country.id")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?topic.id=industry.green_energy_news&facet=true&facet.field=source.bias,source.country.id&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?topic.id=industry.green_energy_news&facet=true&facet.field=source.bias,source.country.id
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersFaceting for category distribution in top headlines:
curl "https://api.apitube.io/v1/news/top-headlines?facet=true&facet.field=category.id,language.id&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/top-headlines",
params={
"facet": "true",
"facet.field": "category.id,language.id",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "facet": "true", "facet.field": "category.id,language.id", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/top-headlines?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["facet" => "true", "facet.field" => "category.id,language.id", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/top-headlines?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/top-headlines")
q := u.Query()
q.Set("facet", "true")
q.Set("facet.field", "category.id,language.id")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/top-headlines?facet=true&facet.field=category.id,language.id&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/top-headlines?facet=true&facet.field=category.id,language.id
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersBuilding a filtered navigation:
This example shows how to use facets to build a filter sidebar for your news application:
curl "https://api.apitube.io/v1/news/everything?title=AI&facet=true&facet.field=source.id,category.id,language.id,sentiment.overall.polarity&facet.limit=10&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "AI",
"facet": "true",
"facet.field": "source.id,category.id,language.id,sentiment.overall.polarity",
"facet.limit": "10",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "AI", "facet": "true", "facet.field": "source.id,category.id,language.id,sentiment.overall.polarity", "facet.limit": "10", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "AI", "facet" => "true", "facet.field" => "source.id,category.id,language.id,sentiment.overall.polarity", "facet.limit" => "10", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "AI")
q.Set("facet", "true")
q.Set("facet.field", "source.id,category.id,language.id,sentiment.overall.polarity")
q.Set("facet.limit", "10")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=AI&facet=true&facet.field=source.id,category.id,language.id,sentiment.overall.polarity&facet.limit=10&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=AI&facet=true&facet.field=source.id,category.id,language.id,sentiment.overall.polarity&facet.limit=10
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersTemporal analysis – articles by hour of day:
curl "https://api.apitube.io/v1/news/everything?facet=true&facet.field=published.hour&published_at.start=2024-01-01&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"facet": "true",
"facet.field": "published.hour",
"published_at.start": "2024-01-01",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "facet": "true", "facet.field": "published.hour", "published_at.start": "2024-01-01", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["facet" => "true", "facet.field" => "published.hour", "published_at.start" => "2024-01-01", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("facet", "true")
q.Set("facet.field", "published.hour")
q.Set("published_at.start", "2024-01-01")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?facet=true&facet.field=published.hour&published_at.start=2024-01-01&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?facet=true&facet.field=published.hour&published_at.start=2024-01-01
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersTemporal analysis – articles by day of week:
curl "https://api.apitube.io/v1/news/everything?facet=true&facet.field=published.day_of_week&category.id=medtop:15000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"facet": "true",
"facet.field": "published.day_of_week",
"category.id": "medtop:15000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "facet": "true", "facet.field": "published.day_of_week", "category.id": "medtop:15000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["facet" => "true", "facet.field" => "published.day_of_week", "category.id" => "medtop:15000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("facet", "true")
q.Set("facet.field", "published.day_of_week")
q.Set("category.id", "medtop:15000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?facet=true&facet.field=published.day_of_week&category.id=medtop:15000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?facet=true&facet.field=published.day_of_week&category.id=medtop:15000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMedia richness analysis:
curl "https://api.apitube.io/v1/news/everything?facet=true&facet.field=media.images.count,media.videos.count&category.id=medtop:13000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"facet": "true",
"facet.field": "media.images.count,media.videos.count",
"category.id": "medtop:13000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "facet": "true", "facet.field": "media.images.count,media.videos.count", "category.id": "medtop:13000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["facet" => "true", "facet.field" => "media.images.count,media.videos.count", "category.id" => "medtop:13000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("facet", "true")
q.Set("facet.field", "media.images.count,media.videos.count")
q.Set("category.id", "medtop:13000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?facet=true&facet.field=media.images.count,media.videos.count&category.id=medtop:13000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?facet=true&facet.field=media.images.count,media.videos.count&category.id=medtop:13000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersSource quality distribution:
curl "https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.rank.opr,is_duplicate&published_at.start=2024-01-01&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"facet": "true",
"facet.field": "source.rank.opr,is_duplicate",
"published_at.start": "2024-01-01",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "facet": "true", "facet.field": "source.rank.opr,is_duplicate", "published_at.start": "2024-01-01", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["facet" => "true", "facet.field" => "source.rank.opr,is_duplicate", "published_at.start" => "2024-01-01", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("facet", "true")
q.Set("facet.field", "source.rank.opr,is_duplicate")
q.Set("published_at.start", "2024-01-01")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.rank.opr,is_duplicate&published_at.start=2024-01-01&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?facet=true&facet.field=source.rank.opr,is_duplicate&published_at.start=2024-01-01
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersBreaking news distribution by hour:
curl "https://api.apitube.io/v1/news/everything?is_breaking=1&facet=true&facet.field=published.hour,category.id&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_breaking": "1",
"facet": "true",
"facet.field": "published.hour,category.id",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_breaking": "1", "facet": "true", "facet.field": "published.hour,category.id", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_breaking" => "1", "facet" => "true", "facet.field" => "published.hour,category.id", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_breaking", "1")
q.Set("facet", "true")
q.Set("facet.field", "published.hour,category.id")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_breaking=1&facet=true&facet.field=published.hour,category.id&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_breaking=1&facet=true&facet.field=published.hour,category.id
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersContent length analysis:
curl "https://api.apitube.io/v1/news/everything?facet=true&facet.field=read_time&category.id=medtop:04000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"facet": "true",
"facet.field": "read_time",
"category.id": "medtop:04000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "facet": "true", "facet.field": "read_time", "category.id": "medtop:04000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["facet" => "true", "facet.field" => "read_time", "category.id" => "medtop:04000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("facet", "true")
q.Set("facet.field", "read_time")
q.Set("category.id", "medtop:04000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?facet=true&facet.field=read_time&category.id=medtop:04000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?facet=true&facet.field=read_time&category.id=medtop:04000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMulti-sentiment analysis across content parts:
curl "https://api.apitube.io/v1/news/everything?organization.name=Tesla&facet=true&facet.field=sentiment.overall.polarity,sentiment.title.polarity,sentiment.body.polarity&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Tesla",
"facet": "true",
"facet.field": "sentiment.overall.polarity,sentiment.title.polarity,sentiment.body.polarity",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Tesla", "facet": "true", "facet.field": "sentiment.overall.polarity,sentiment.title.polarity,sentiment.body.polarity", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Tesla", "facet" => "true", "facet.field" => "sentiment.overall.polarity,sentiment.title.polarity,sentiment.body.polarity", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Tesla")
q.Set("facet", "true")
q.Set("facet.field", "sentiment.overall.polarity,sentiment.title.polarity,sentiment.body.polarity")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Tesla&facet=true&facet.field=sentiment.overall.polarity,sentiment.title.polarity,sentiment.body.polarity&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Tesla&facet=true&facet.field=sentiment.overall.polarity,sentiment.title.polarity,sentiment.body.polarity
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersYearly trend analysis:
curl "https://api.apitube.io/v1/news/everything?topic.id=industry.ai_news&facet=true&facet.field=published.year,published.month&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"topic.id": "industry.ai_news",
"facet": "true",
"facet.field": "published.year,published.month",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "topic.id": "industry.ai_news", "facet": "true", "facet.field": "published.year,published.month", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["topic.id" => "industry.ai_news", "facet" => "true", "facet.field" => "published.year,published.month", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("topic.id", "industry.ai_news")
q.Set("facet", "true")
q.Set("facet.field", "published.year,published.month")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?topic.id=industry.ai_news&facet=true&facet.field=published.year,published.month&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?topic.id=industry.ai_news&facet=true&facet.field=published.year,published.month
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersContent length distribution:
curl "https://api.apitube.io/v1/news/everything?facet=true&facet.field=content.length&category.id=medtop:04000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"facet": "true",
"facet.field": "content.length",
"category.id": "medtop:04000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "facet": "true", "facet.field": "content.length", "category.id": "medtop:04000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["facet" => "true", "facet.field" => "content.length", "category.id" => "medtop:04000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("facet", "true")
q.Set("facet.field", "content.length")
q.Set("category.id", "medtop:04000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?facet=true&facet.field=content.length&category.id=medtop:04000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?facet=true&facet.field=content.length&category.id=medtop:04000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersWeekday vs weekend publishing patterns:
curl "https://api.apitube.io/v1/news/everything?facet=true&facet.field=published.weekday,published.time_of_day&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"facet": "true",
"facet.field": "published.weekday,published.time_of_day",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "facet": "true", "facet.field": "published.weekday,published.time_of_day", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["facet" => "true", "facet.field" => "published.weekday,published.time_of_day", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("facet", "true")
q.Set("facet.field", "published.weekday,published.time_of_day")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?facet=true&facet.field=published.weekday,published.time_of_day&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?facet=true&facet.field=published.weekday,published.time_of_day
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersSentiment strength analysis:
curl "https://api.apitube.io/v1/news/everything?organization.name=Tesla&facet=true&facet.field=sentiment.strength,sentiment.overall.polarity&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Tesla",
"facet": "true",
"facet.field": "sentiment.strength,sentiment.overall.polarity",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Tesla", "facet": "true", "facet.field": "sentiment.strength,sentiment.overall.polarity", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Tesla", "facet" => "true", "facet.field" => "sentiment.strength,sentiment.overall.polarity", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Tesla")
q.Set("facet", "true")
q.Set("facet.field", "sentiment.strength,sentiment.overall.polarity")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Tesla&facet=true&facet.field=sentiment.strength,sentiment.overall.polarity&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Tesla&facet=true&facet.field=sentiment.strength,sentiment.overall.polarity
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMost mentioned entities:
curl "https://api.apitube.io/v1/news/everything?facet=true&facet.field=entity.id&facet.limit=20&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"facet": "true",
"facet.field": "entity.id",
"facet.limit": "20",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "facet": "true", "facet.field": "entity.id", "facet.limit": "20", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["facet" => "true", "facet.field" => "entity.id", "facet.limit" => "20", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("facet", "true")
q.Set("facet.field", "entity.id")
q.Set("facet.limit", "20")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?facet=true&facet.field=entity.id&facet.limit=20&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?facet=true&facet.field=entity.id&facet.limit=20
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersTime of day publishing analysis:
curl "https://api.apitube.io/v1/news/everything?is_breaking=1&facet=true&facet.field=published.time_of_day,published.weekday&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_breaking": "1",
"facet": "true",
"facet.field": "published.time_of_day,published.weekday",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_breaking": "1", "facet": "true", "facet.field": "published.time_of_day,published.weekday", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_breaking" => "1", "facet" => "true", "facet.field" => "published.time_of_day,published.weekday", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_breaking", "1")
q.Set("facet", "true")
q.Set("facet.field", "published.time_of_day,published.weekday")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_breaking=1&facet=true&facet.field=published.time_of_day,published.weekday&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_breaking=1&facet=true&facet.field=published.time_of_day,published.weekday
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Range Faceting
Range faceting allows you to create histogram-style bucketed counts for numeric and date fields. This is perfect for building timelines, distribution charts, and analytics dashboards.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Default | Required |
|---|---|---|---|---|
facet.range | Enable range faceting. Set to true or 1 to enable. | boolean | false | No |
facet.range.field | Field to create ranges on. | string | - | Yes (when facet.range=true) |
facet.range.start | Start value for the range (date or number). | string | - | Yes (when facet.range=true) |
facet.range.end | End value for the range (date or number). | string | - | Yes (when facet.range=true) |
facet.range.gap | Gap/interval between ranges. For dates: 1HOUR, 1DAY, 1WEEK, 1MONTH, 1YEAR or short aliases 1h, 1d, 1w, 1m, 1y. For numbers: numeric value (e.g., 0.1, 5). | string | 1DAY | No |
Supported Range Facet Fields
Date Fields
| Field | Description | Gap Examples |
|---|---|---|
published_at | Article publication date | 1HOUR, 1DAY, 1WEEK, 1MONTH, 1h, 1d, 1w, 1m |
Numeric Fields
| Field | Description | Typical Range | Gap Examples |
|---|---|---|---|
sentiment.overall.score | Overall sentiment score | -1 to 1 | 0.1, 0.25, 0.5 |
sentiment.title.score | Title sentiment score | -1 to 1 | 0.1, 0.25, 0.5 |
sentiment.body.score | Body sentiment score | -1 to 1 | 0.1, 0.25, 0.5 |
read_time | Reading time in minutes | 0 to 60 | 1, 5, 10 |
source.rank.opr | Source OpenPageRank | 0.1 to 0.9 | 0.1, 0.2 |
media.images.count | Number of images | 0 to 50 | 1, 5 |
media.videos.count | Number of videos | 0 to 20 | 1, 5 |
Response Format
When range faceting is enabled, the response includes range buckets in the facets object:
{
"status": "ok",
"results": [...],
"facets": {
"published_at_ranges": [
{"range_start": "2024-01-01", "range_end": "2024-01-08", "count": 1250},
{"range_start": "2024-01-08", "range_end": "2024-01-15", "count": 1180},
{"range_start": "2024-01-15", "range_end": "2024-01-22", "count": 1340}
]
}
}For numeric ranges:
{
"status": "ok",
"results": [...],
"facets": {
"sentiment.overall.score_ranges": [
{"range_start": -1.0, "range_end": -0.5, "count": 450},
{"range_start": -0.5, "range_end": 0.0, "count": 820},
{"range_start": 0.0, "range_end": 0.5, "count": 1250},
{"range_start": 0.5, "range_end": 1.0, "count": 680}
]
}
}Workflow examples
Date range faceting - articles per week:
curl "https://api.apitube.io/v1/news/everything?title=bitcoin&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-03-01&facet.range.gap=1WEEK&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "bitcoin",
"facet.range": "true",
"facet.range.field": "published_at",
"facet.range.start": "2024-01-01",
"facet.range.end": "2024-03-01",
"facet.range.gap": "1WEEK",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "bitcoin", "facet.range": "true", "facet.range.field": "published_at", "facet.range.start": "2024-01-01", "facet.range.end": "2024-03-01", "facet.range.gap": "1WEEK", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "bitcoin", "facet.range" => "true", "facet.range.field" => "published_at", "facet.range.start" => "2024-01-01", "facet.range.end" => "2024-03-01", "facet.range.gap" => "1WEEK", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "bitcoin")
q.Set("facet.range", "true")
q.Set("facet.range.field", "published_at")
q.Set("facet.range.start", "2024-01-01")
q.Set("facet.range.end", "2024-03-01")
q.Set("facet.range.gap", "1WEEK")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=bitcoin&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-03-01&facet.range.gap=1WEEK&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=bitcoin&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-03-01&facet.range.gap=1WEEK
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersDate range faceting – articles per day:
curl "https://api.apitube.io/v1/news/everything?organization.name=Tesla&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-01-31&facet.range.gap=1DAY&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Tesla",
"facet.range": "true",
"facet.range.field": "published_at",
"facet.range.start": "2024-01-01",
"facet.range.end": "2024-01-31",
"facet.range.gap": "1DAY",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Tesla", "facet.range": "true", "facet.range.field": "published_at", "facet.range.start": "2024-01-01", "facet.range.end": "2024-01-31", "facet.range.gap": "1DAY", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Tesla", "facet.range" => "true", "facet.range.field" => "published_at", "facet.range.start" => "2024-01-01", "facet.range.end" => "2024-01-31", "facet.range.gap" => "1DAY", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Tesla")
q.Set("facet.range", "true")
q.Set("facet.range.field", "published_at")
q.Set("facet.range.start", "2024-01-01")
q.Set("facet.range.end", "2024-01-31")
q.Set("facet.range.gap", "1DAY")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Tesla&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-01-31&facet.range.gap=1DAY&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Tesla&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-01-31&facet.range.gap=1DAY
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersDate range faceting - hourly distribution:
curl "https://api.apitube.io/v1/news/everything?is_breaking=1&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-15&facet.range.end=2024-01-16&facet.range.gap=1HOUR&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_breaking": "1",
"facet.range": "true",
"facet.range.field": "published_at",
"facet.range.start": "2024-01-15",
"facet.range.end": "2024-01-16",
"facet.range.gap": "1HOUR",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_breaking": "1", "facet.range": "true", "facet.range.field": "published_at", "facet.range.start": "2024-01-15", "facet.range.end": "2024-01-16", "facet.range.gap": "1HOUR", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_breaking" => "1", "facet.range" => "true", "facet.range.field" => "published_at", "facet.range.start" => "2024-01-15", "facet.range.end" => "2024-01-16", "facet.range.gap" => "1HOUR", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_breaking", "1")
q.Set("facet.range", "true")
q.Set("facet.range.field", "published_at")
q.Set("facet.range.start", "2024-01-15")
q.Set("facet.range.end", "2024-01-16")
q.Set("facet.range.gap", "1HOUR")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_breaking=1&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-15&facet.range.end=2024-01-16&facet.range.gap=1HOUR&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_breaking=1&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-15&facet.range.end=2024-01-16&facet.range.gap=1HOUR
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersSentiment distribution analysis:
curl "https://api.apitube.io/v1/news/everything?organization.name=Apple&facet.range=true&facet.range.field=sentiment.overall.score&facet.range.start=-1&facet.range.end=1&facet.range.gap=0.25&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Apple",
"facet.range": "true",
"facet.range.field": "sentiment.overall.score",
"facet.range.start": "-1",
"facet.range.end": "1",
"facet.range.gap": "0.25",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Apple", "facet.range": "true", "facet.range.field": "sentiment.overall.score", "facet.range.start": "-1", "facet.range.end": "1", "facet.range.gap": "0.25", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Apple", "facet.range" => "true", "facet.range.field" => "sentiment.overall.score", "facet.range.start" => "-1", "facet.range.end" => "1", "facet.range.gap" => "0.25", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Apple")
q.Set("facet.range", "true")
q.Set("facet.range.field", "sentiment.overall.score")
q.Set("facet.range.start", "-1")
q.Set("facet.range.end", "1")
q.Set("facet.range.gap", "0.25")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Apple&facet.range=true&facet.range.field=sentiment.overall.score&facet.range.start=-1&facet.range.end=1&facet.range.gap=0.25&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Apple&facet.range=true&facet.range.field=sentiment.overall.score&facet.range.start=-1&facet.range.end=1&facet.range.gap=0.25
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersReading time distribution:
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&facet.range=true&facet.range.field=read_time&facet.range.start=0&facet.range.end=30&facet.range.gap=5&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"category.id": "medtop:04000000",
"facet.range": "true",
"facet.range.field": "read_time",
"facet.range.start": "0",
"facet.range.end": "30",
"facet.range.gap": "5",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "category.id": "medtop:04000000", "facet.range": "true", "facet.range.field": "read_time", "facet.range.start": "0", "facet.range.end": "30", "facet.range.gap": "5", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["category.id" => "medtop:04000000", "facet.range" => "true", "facet.range.field" => "read_time", "facet.range.start" => "0", "facet.range.end" => "30", "facet.range.gap" => "5", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("category.id", "medtop:04000000")
q.Set("facet.range", "true")
q.Set("facet.range.field", "read_time")
q.Set("facet.range.start", "0")
q.Set("facet.range.end", "30")
q.Set("facet.range.gap", "5")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&facet.range=true&facet.range.field=read_time&facet.range.start=0&facet.range.end=30&facet.range.gap=5&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&facet.range=true&facet.range.field=read_time&facet.range.start=0&facet.range.end=30&facet.range.gap=5
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersSource quality distribution:
curl "https://api.apitube.io/v1/news/everything?topic.id=industry.ai_news&facet.range=true&facet.range.field=source.rank.opr&facet.range.start=0.1&facet.range.end=0.9&facet.range.gap=0.1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"topic.id": "industry.ai_news",
"facet.range": "true",
"facet.range.field": "source.rank.opr",
"facet.range.start": "0.1",
"facet.range.end": "0.9",
"facet.range.gap": "0.1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "topic.id": "industry.ai_news", "facet.range": "true", "facet.range.field": "source.rank.opr", "facet.range.start": "0.1", "facet.range.end": "0.9", "facet.range.gap": "0.1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["topic.id" => "industry.ai_news", "facet.range" => "true", "facet.range.field" => "source.rank.opr", "facet.range.start" => "0.1", "facet.range.end" => "0.9", "facet.range.gap" => "0.1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("topic.id", "industry.ai_news")
q.Set("facet.range", "true")
q.Set("facet.range.field", "source.rank.opr")
q.Set("facet.range.start", "0.1")
q.Set("facet.range.end", "0.9")
q.Set("facet.range.gap", "0.1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?topic.id=industry.ai_news&facet.range=true&facet.range.field=source.rank.opr&facet.range.start=0.1&facet.range.end=0.9&facet.range.gap=0.1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?topic.id=industry.ai_news&facet.range=true&facet.range.field=source.rank.opr&facet.range.start=0.1&facet.range.end=0.9&facet.range.gap=0.1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCombined regular and range faceting:
curl "https://api.apitube.io/v1/news/everything?title=climate&facet=true&facet.field=source.country.id,language.id&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-06-01&facet.range.gap=1MONTH&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "climate",
"facet": "true",
"facet.field": "source.country.id,language.id",
"facet.range": "true",
"facet.range.field": "published_at",
"facet.range.start": "2024-01-01",
"facet.range.end": "2024-06-01",
"facet.range.gap": "1MONTH",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "climate", "facet": "true", "facet.field": "source.country.id,language.id", "facet.range": "true", "facet.range.field": "published_at", "facet.range.start": "2024-01-01", "facet.range.end": "2024-06-01", "facet.range.gap": "1MONTH", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "climate", "facet" => "true", "facet.field" => "source.country.id,language.id", "facet.range" => "true", "facet.range.field" => "published_at", "facet.range.start" => "2024-01-01", "facet.range.end" => "2024-06-01", "facet.range.gap" => "1MONTH", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "climate")
q.Set("facet", "true")
q.Set("facet.field", "source.country.id,language.id")
q.Set("facet.range", "true")
q.Set("facet.range.field", "published_at")
q.Set("facet.range.start", "2024-01-01")
q.Set("facet.range.end", "2024-06-01")
q.Set("facet.range.gap", "1MONTH")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=climate&facet=true&facet.field=source.country.id,language.id&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-06-01&facet.range.gap=1MONTH&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=climate&facet=true&facet.field=source.country.id,language.id&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-06-01&facet.range.gap=1MONTH
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMedia richness timeline:
curl "https://api.apitube.io/v1/news/everything?has_image=1&facet.range=true&facet.range.field=media.images.count&facet.range.start=1&facet.range.end=20&facet.range.gap=2&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"has_image": "1",
"facet.range": "true",
"facet.range.field": "media.images.count",
"facet.range.start": "1",
"facet.range.end": "20",
"facet.range.gap": "2",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "has_image": "1", "facet.range": "true", "facet.range.field": "media.images.count", "facet.range.start": "1", "facet.range.end": "20", "facet.range.gap": "2", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["has_image" => "1", "facet.range" => "true", "facet.range.field" => "media.images.count", "facet.range.start" => "1", "facet.range.end" => "20", "facet.range.gap" => "2", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("has_image", "1")
q.Set("facet.range", "true")
q.Set("facet.range.field", "media.images.count")
q.Set("facet.range.start", "1")
q.Set("facet.range.end", "20")
q.Set("facet.range.gap", "2")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?has_image=1&facet.range=true&facet.range.field=media.images.count&facet.range.start=1&facet.range.end=20&facet.range.gap=2&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?has_image=1&facet.range=true&facet.range.field=media.images.count&facet.range.start=1&facet.range.end=20&facet.range.gap=2
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersBuilding a sentiment timeline dashboard:
This example shows how to track sentiment changes over time for brand monitoring:
curl "https://api.apitube.io/v1/news/everything?organization.name=Apple&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-12-31&facet.range.gap=1MONTH&sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Apple",
"facet.range": "true",
"facet.range.field": "published_at",
"facet.range.start": "2024-01-01",
"facet.range.end": "2024-12-31",
"facet.range.gap": "1MONTH",
"sentiment.overall.polarity": "positive",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Apple", "facet.range": "true", "facet.range.field": "published_at", "facet.range.start": "2024-01-01", "facet.range.end": "2024-12-31", "facet.range.gap": "1MONTH", "sentiment.overall.polarity": "positive", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Apple", "facet.range" => "true", "facet.range.field" => "published_at", "facet.range.start" => "2024-01-01", "facet.range.end" => "2024-12-31", "facet.range.gap" => "1MONTH", "sentiment.overall.polarity" => "positive", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Apple")
q.Set("facet.range", "true")
q.Set("facet.range.field", "published_at")
q.Set("facet.range.start", "2024-01-01")
q.Set("facet.range.end", "2024-12-31")
q.Set("facet.range.gap", "1MONTH")
q.Set("sentiment.overall.polarity", "positive")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Apple&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-12-31&facet.range.gap=1MONTH&sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Apple&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-12-31&facet.range.gap=1MONTH&sentiment.overall.polarity=positive
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersComparative time series analysis:
Run multiple queries to compare different entities over the same time period:
# Tesla coverage timeline
curl -X GET "https://api.apitube.io/v1/news/everything?organization.name=Tesla&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-06-01&facet.range.gap=1WEEK&api_key=YOUR_API_KEY"
# Meta coverage timeline
curl -X GET "https://api.apitube.io/v1/news/everything?organization.name=Meta&facet.range=true&facet.range.field=published_at&facet.range.start=2024-01-01&facet.range.end=2024-06-01&facet.range.gap=1WEEK&api_key=YOUR_API_KEY"More examples can be found on the News API Examples page.
Pagination
With the News API, you can paginate the articles you want to retrieve.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Pagination with limit and offset
You can use the per_page and page parameters to specify the number of articles you want to retrieve and the starting point of the articles.
Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
per_page | The number of articles you want to retrieve. | integer | No |
page | The starting point of the articles. | integer | No |
Workflow examples
Request to get news articles with pagination:
curl "https://api.apitube.io/v1/news/everything?per_page=10&page=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"per_page": "10",
"page": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "per_page": "10", "page": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["per_page" => "10", "page" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("per_page", "10")
q.Set("page", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?per_page=10&page=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?per_page=10&page=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersEfficient Large Dataset Retrieval:
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:13000000&per_page=100&page=1&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"category.id": "medtop:13000000",
"per_page": "100",
"page": "1",
"sort.by": "published_at",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "category.id": "medtop:13000000", "per_page": "100", "page": "1", "sort.by": "published_at", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["category.id" => "medtop:13000000", "per_page" => "100", "page" => "1", "sort.by" => "published_at", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("category.id", "medtop:13000000")
q.Set("per_page", "100")
q.Set("page", "1")
q.Set("sort.by", "published_at")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?category.id=medtop:13000000&per_page=100&page=1&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?category.id=medtop:13000000&per_page=100&page=1&sort.by=published_at&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersPaginated Multi-criteria Search:
curl "https://api.apitube.io/v1/news/everything?organization.name=Amazon&sentiment.overall.polarity=positive&per_page=25&page=3&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"organization.name": "Amazon",
"sentiment.overall.polarity": "positive",
"per_page": "25",
"page": "3",
"sort.by": "published_at",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "organization.name": "Amazon", "sentiment.overall.polarity": "positive", "per_page": "25", "page": "3", "sort.by": "published_at", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["organization.name" => "Amazon", "sentiment.overall.polarity" => "positive", "per_page" => "25", "page" => "3", "sort.by" => "published_at", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("organization.name", "Amazon")
q.Set("sentiment.overall.polarity", "positive")
q.Set("per_page", "25")
q.Set("page", "3")
q.Set("sort.by", "published_at")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?organization.name=Amazon&sentiment.overall.polarity=positive&per_page=25&page=3&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?organization.name=Amazon&sentiment.overall.polarity=positive&per_page=25&page=3&sort.by=published_at&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersOther filters
Other powerful filters are available to help you find the articles you need.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
0 is for false and 1 is for true.
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
article.id | Fetch specific articles by their IDs (comma-separated, max 5). | string | No | 12345 or 12345,67890 |
is_duplicate | Filter articles that are duplicates. | integer | No | 0 |
is_paywall | Filter articles that are behind a paywall | integer | No | 0 |
is_breaking | Filter articles that are breaking news. | integer | No | 1 |
read_time | Filter articles by read time in minutes. | integer | No | 3 |
read_time.min | Filter articles by minimum read time in minutes. | integer | No | 1 |
read_time.max | Filter articles by maximum read time in minutes. | integer | No | 4 |
is_long_read | Filter articles with read time >= 5 minutes. | integer | No | 1 |
is_short_read | Filter articles with read time < 3 minutes. | integer | No | 1 |
is_quick_read | Filter articles with read time <= 2 minutes. | integer | No | 1 |
is_medium_read | Filter articles with read time 3-7 minutes. | integer | No | 1 |
is_deep_dive | Filter articles with read time >= 10 minutes. | integer | No | 1 |
is_high_quality | Filter high quality articles (not duplicate, source rank >= 0.5, has images, has author). | integer | No | 1 |
debug | Include the parsed user_input in the response for debugging. Values: 0, 1. | integer | No | 1 |
Readability Filters
Filter articles by reading difficulty, complexity, and target audience. These filters help you find content suitable for specific reader groups.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/entity
Parameters
Flesch-Kincaid Grade Level
The Flesch-Kincaid Grade Level indicates the US school grade level required to understand the text. Lower values indicate easier content.
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
readability.fk_grade | Filter by exact Flesch-Kincaid grade level (0-30). | float | No | 8.5 |
readability.fk_grade.min | Filter by minimum grade level. | float | No | 6 |
readability.fk_grade.max | Filter by maximum grade level. | float | No | 12 |
Flesch Reading Ease Score
The Flesch Reading Ease score ranges from 0–100, where higher scores indicate easier-to-read content.
| Score Range | Difficulty | Audience |
|---|---|---|
| 90-100 | Very Easy | 5th grade |
| 80-89 | Easy | 6th grade |
| 70-79 | Fairly Easy | 7th grade |
| 60-69 | Standard | 8th-9th grade |
| 50-59 | Fairly Difficult | 10th-12th grade |
| 30-49 | Difficult | College |
| 0-29 | Very Difficult | College graduate |
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
readability.ease | Filter by exact Flesch Reading Ease score (0-100). | float | No | 65 |
readability.ease.min | Filter by minimum ease score (higher = easier). | float | No | 60 |
readability.ease.max | Filter by maximum ease score. | float | No | 80 |
Automated Readability Index (ARI)
The ARI produces a score that approximates the grade level needed to comprehend the text.
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
readability.ari | Filter by exact ARI score (0-30). | float | No | 7.5 |
readability.ari.min | Filter by minimum ARI score. | float | No | 5 |
readability.ari.max | Filter by maximum ARI score. | float | No | 10 |
Difficulty Level
Filter by categorical difficulty level.
| Parameter | Description | Type | Required | Values |
|---|---|---|---|---|
readability.difficulty | Filter by difficulty level. | string | No | beginner, intermediate, advanced, expert |
| Difficulty Level | Grade Range | Description |
|---|---|---|
beginner | < 6 | Easy to read, suitable for general audience |
intermediate | 6-10 | Standard difficulty, high school level |
advanced | 10-14 | Complex content, college level |
expert | 14+ | Highly complex, professional/academic level |
Target Audience
Filter by the intended target audience based on content complexity.
| Parameter | Description | Type | Required | Values |
|---|---|---|---|---|
readability.audience | Filter by target audience. | string | No | children, general, professional, academic |
| Audience | Description |
|---|---|
children | Content suitable for children (grade < 6) |
general | Content for general public (grade 6-10) |
professional | Professional/business content (grade 10-14) |
academic | Academic/scholarly content (grade 14+) |
Reading Age
Filter by recommended reader age (calculated as grade level + 5).
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
readability.age | Filter by exact reading age (6-22). | integer | No | 14 |
readability.age.min | Filter by minimum reading age. | integer | No | 12 |
readability.age.max | Filter by maximum reading age. | integer | No | 16 |
Convenience Filters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
is_easy_read | Filter easy-to-read articles (Flesch Reading Ease ≥ 60). | integer | No | 1 |
is_difficult_read | Filter difficult articles (Flesch Reading Ease < 40). | integer | No | 1 |
Examples
Get easy-to-read articles for the general audience:
curl "https://api.apitube.io/v1/news/everything?is_easy_read=1&readability.audience=general&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_easy_read": "1",
"readability.audience": "general",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_easy_read": "1", "readability.audience": "general", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_easy_read" => "1", "readability.audience" => "general", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_easy_read", "1")
q.Set("readability.audience", "general")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_easy_read=1&readability.audience=general&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_easy_read=1&readability.audience=general
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersGet beginner-level content about technology:
curl "https://api.apitube.io/v1/news/everything?readability.difficulty=beginner&topic.id=industry.technology_news&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"readability.difficulty": "beginner",
"topic.id": "industry.technology_news",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "readability.difficulty": "beginner", "topic.id": "industry.technology_news", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["readability.difficulty" => "beginner", "topic.id" => "industry.technology_news", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("readability.difficulty", "beginner")
q.Set("topic.id", "industry.technology_news")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?readability.difficulty=beginner&topic.id=industry.technology_news&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?readability.difficulty=beginner&topic.id=industry.technology_news
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersGet articles suitable for teenagers (age 12–16):
curl "https://api.apitube.io/v1/news/everything?readability.age.min=12&readability.age.max=16&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"readability.age.min": "12",
"readability.age.max": "16",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "readability.age.min": "12", "readability.age.max": "16", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["readability.age.min" => "12", "readability.age.max" => "16", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("readability.age.min", "12")
q.Set("readability.age.max", "16")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?readability.age.min=12&readability.age.max=16&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?readability.age.min=12&readability.age.max=16
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersGet professional-level business news:
curl "https://api.apitube.io/v1/news/everything?readability.audience=professional&category.id=medtop:04000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"readability.audience": "professional",
"category.id": "medtop:04000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "readability.audience": "professional", "category.id": "medtop:04000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["readability.audience" => "professional", "category.id" => "medtop:04000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("readability.audience", "professional")
q.Set("category.id", "medtop:04000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?readability.audience=professional&category.id=medtop:04000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?readability.audience=professional&category.id=medtop:04000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersGet highly readable content (FRE 70–90) for content curation:
curl "https://api.apitube.io/v1/news/everything?readability.ease.min=70&readability.ease.max=90&is_duplicate=0&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"readability.ease.min": "70",
"readability.ease.max": "90",
"is_duplicate": "0",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "readability.ease.min": "70", "readability.ease.max": "90", "is_duplicate": "0", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["readability.ease.min" => "70", "readability.ease.max" => "90", "is_duplicate" => "0", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("readability.ease.min", "70")
q.Set("readability.ease.max", "90")
q.Set("is_duplicate", "0")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?readability.ease.min=70&readability.ease.max=90&is_duplicate=0&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?readability.ease.min=70&readability.ease.max=90&is_duplicate=0
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersGet academic-level articles about science:
curl "https://api.apitube.io/v1/news/everything?readability.difficulty=expert&readability.audience=academic&category.id=medtop:13000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"readability.difficulty": "expert",
"readability.audience": "academic",
"category.id": "medtop:13000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "readability.difficulty": "expert", "readability.audience": "academic", "category.id": "medtop:13000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["readability.difficulty" => "expert", "readability.audience" => "academic", "category.id" => "medtop:13000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("readability.difficulty", "expert")
q.Set("readability.audience", "academic")
q.Set("category.id", "medtop:13000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?readability.difficulty=expert&readability.audience=academic&category.id=medtop:13000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?readability.difficulty=expert&readability.audience=academic&category.id=medtop:13000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCombine with grade level for educational content:
curl "https://api.apitube.io/v1/news/everything?readability.fk_grade.min=8&readability.fk_grade.max=12&category.id=medtop:13000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"readability.fk_grade.min": "8",
"readability.fk_grade.max": "12",
"category.id": "medtop:13000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "readability.fk_grade.min": "8", "readability.fk_grade.max": "12", "category.id": "medtop:13000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["readability.fk_grade.min" => "8", "readability.fk_grade.max" => "12", "category.id" => "medtop:13000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("readability.fk_grade.min", "8")
q.Set("readability.fk_grade.max", "12")
q.Set("category.id", "medtop:13000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?readability.fk_grade.min=8&readability.fk_grade.max=12&category.id=medtop:13000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?readability.fk_grade.min=8&readability.fk_grade.max=12&category.id=medtop:13000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersOther Filters
High-Quality Content Filtering:
curl "https://api.apitube.io/v1/news/everything?is_duplicate=0&is_paywall=0&source.rank.opr.min=0.6&category.id=medtop:04000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_duplicate": "0",
"is_paywall": "0",
"source.rank.opr.min": "0.6",
"category.id": "medtop:04000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_duplicate": "0", "is_paywall": "0", "source.rank.opr.min": "0.6", "category.id": "medtop:04000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_duplicate" => "0", "is_paywall" => "0", "source.rank.opr.min" => "0.6", "category.id" => "medtop:04000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_duplicate", "0")
q.Set("is_paywall", "0")
q.Set("source.rank.opr.min", "0.6")
q.Set("category.id", "medtop:04000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_duplicate=0&is_paywall=0&source.rank.opr.min=0.6&category.id=medtop:04000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_duplicate=0&is_paywall=0&source.rank.opr.min=0.6&category.id=medtop:04000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for long-read articles:
curl "https://api.apitube.io/v1/news/everything?is_long_read=1&category.id=medtop:04000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_long_read": "1",
"category.id": "medtop:04000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_long_read": "1", "category.id": "medtop:04000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_long_read" => "1", "category.id" => "medtop:04000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_long_read", "1")
q.Set("category.id", "medtop:04000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_long_read=1&category.id=medtop:04000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_long_read=1&category.id=medtop:04000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for quick-read articles:
curl "https://api.apitube.io/v1/news/everything?is_short_read=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_short_read": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_short_read": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_short_read" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_short_read", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_short_read=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_short_read=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for quick news briefs (≤2 minutes):
curl "https://api.apitube.io/v1/news/everything?is_quick_read=1&category.id=medtop:04000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_quick_read": "1",
"category.id": "medtop:04000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_quick_read": "1", "category.id": "medtop:04000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_quick_read" => "1", "category.id" => "medtop:04000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_quick_read", "1")
q.Set("category.id", "medtop:04000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_quick_read=1&category.id=medtop:04000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_quick_read=1&category.id=medtop:04000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for standard-length articles (3-7 minutes):
curl "https://api.apitube.io/v1/news/everything?is_medium_read=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_medium_read": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_medium_read": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_medium_read" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_medium_read", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_medium_read=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_medium_read=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for in-depth analysis articles (≥10 minutes):
curl "https://api.apitube.io/v1/news/everything?is_deep_dive=1&category.id=medtop:04000000&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_deep_dive": "1",
"category.id": "medtop:04000000",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_deep_dive": "1", "category.id": "medtop:04000000", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_deep_dive" => "1", "category.id" => "medtop:04000000", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_deep_dive", "1")
q.Set("category.id", "medtop:04000000")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_deep_dive=1&category.id=medtop:04000000&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_deep_dive=1&category.id=medtop:04000000
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for high-quality curated content:
curl "https://api.apitube.io/v1/news/everything?is_high_quality=1&language.code=en&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_high_quality": "1",
"language.code": "en",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_high_quality": "1", "language.code": "en", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_high_quality" => "1", "language.code" => "en", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_high_quality", "1")
q.Set("language.code", "en")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_high_quality=1&language.code=en&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_high_quality=1&language.code=en
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersRequest for media-rich articles sorted by media content:
curl "https://api.apitube.io/v1/news/everything?has_image=1&sort.by=media_richness&sort.order=desc&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"has_image": "1",
"sort.by": "media_richness",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "has_image": "1", "sort.by": "media_richness", "sort.order": "desc", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["has_image" => "1", "sort.by" => "media_richness", "sort.order" => "desc", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("has_image", "1")
q.Set("sort.by", "media_richness")
q.Set("sort.order", "desc")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?has_image=1&sort.by=media_richness&sort.order=desc&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?has_image=1&sort.by=media_richness&sort.order=desc
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersOnly Breaking News Monitoring:
curl "https://api.apitube.io/v1/news/everything?is_breaking=1&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"is_breaking": "1",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "is_breaking": "1", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["is_breaking" => "1", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("is_breaking", "1")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?is_breaking=1&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?is_breaking=1
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Export articles
With the News API, you can export the articles in formats such as JSON, XML, XLSX, CSV, TSV, RSS, Parquet, JSONL, and NDJSON.
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/article
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
export | The format in which you want to export. | string | No | json |
Formats
| Format | Description |
|---|---|
json | JSON |
xml | XML |
xlsx | XLSX |
csv | CSV |
tsv | TSV |
rss | RSS |
parquet | Parquet file |
jsonl | JSONL |
ndjson | NDJSON (alias for JSONL) |
Data Export for Financial Analysis:
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&export=xlsx&api_key=YOUR_API_KEY" -o financial_news.xlsxCSV Export for Sentiment Analysis:
curl -X GET "https://api.apitube.io/v1/news/everything?organization.name=Amazon,Microsoft,Google&sort.by=sentiment.overall.score&sort.order=desc&export=csv&api_key=YOUR_API_KEY" -o tech_sentiment.csvMore examples can be found on the News API Examples page.
Get a single article
Get a single article by its ID.
Endpoints
/v1/news/article
Parameters
| Parameter | Description | Type | Required | Example |
|---|---|---|---|---|
id | The ID of the article you want to retrieve. Supports up to 100 articles simultaneously, separated by commas (OR logic). | string | Yes | 314 |
Workflow examples
Request to get a single article by its ID:
curl "https://api.apitube.io/v1/news/article?id=3036291250&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/article",
params={
"id": "3036291250",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "id": "3036291250", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/article?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["id" => "3036291250", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/article?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/article")
q := u.Query()
q.Set("id", "3036291250")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/article?id=3036291250&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/article?id=3036291250
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersDetailed Article Export in Multiple Formats:
curl -X GET "https://api.apitube.io/v1/news/article?id=3036291250&export=json&api_key=YOUR_API_KEY" -o article_3036291250.json
curl -X GET "https://api.apitube.io/v1/news/article?id=3036291250&export=xml&api_key=YOUR_API_KEY" -o article_3036291250.xmlMore examples can be found on the News API Examples page.
API Usage
Check your API key balance and usage information.
Endpoints
/v1/balance
Parameters
The endpoint accepts the API key in one of three ways:
| Method | Description | Example |
|---|---|---|
| Authorization header | Bearer token in Authorization header | Authorization: Bearer YOUR_KEY |
| X-API-Key header | Custom header with API key | X-API-Key: YOUR_KEY |
| Query parameter | API key as query string parameter | ?api_key=YOUR_KEY |
Response
| Field | Description | Type | Example |
|---|---|---|---|
api_key | Your API key | string | abc123 |
points | Remaining credits/points on your account | integer | 1500 |
plan | Your current subscription plan | string | basic |
Rate Limiting
This endpoint is rate-limited to 5 requests per minute per API key to prevent abuse.
If you exceed the rate limit, you will receive a 429 Too Many Requests response with the following headers:
| Header | Description |
|---|---|
| x-ratelimit-limit | Maximum number of requests allowed (30) |
| x-ratelimit-remaining | Number of requests remaining in the current time window |
| x-ratelimit-reset | Seconds until the rate limit resets |
| retry-after | Seconds to wait before making another request |
Workflow examples
Check API key balance using the query parameter:
curl "https://api.apitube.io/v1/balance?api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/balance",
params={
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/balance?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/balance?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/balance")
q := u.Query()
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/balance?api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/balance
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCheck API key balance using the Authorization header:
curl -X GET "https://api.apitube.io/v1/balance" -H "Authorization: Bearer YOUR_API_KEY"Check API key balance using X-API-Key header:
curl -X GET "https://api.apitube.io/v1/balance" -H "X-API-Key: YOUR_API_KEY"Example response:
{
"api_key": "YOUR_API_KEY",
"points": 1500,
"plan": "basic"
}Example rate limit error response:
{
"statusCode": 429,
"errors": [
{
"code": "ER0203",
"message": "Rate limit exceeded. You can make 30 requests per minute. Try again in 1 minute."
}
]
}Highlighting
Highlighting allows you to get text snippets with matching search terms highlighted. This is useful for displaying search results with context and making it easy for users to see why each result matched.
Advanced Features:
- Automatically expands search terms using synonyms and morphology from the dictionary
- Highlights variations of your search terms (e.g., searching for "run" will also highlight "running", "runner", "ran")
- Supports multilingual highlighting with language-specific dictionaries
Endpoints
/v1/news/everything
/v1/news/top-headlines
/v1/news/story
/v1/news/category
/v1/news/topic
/v1/news/industry
/v1/news/entity
Parameters
| Parameter | Description | Type | Default | Required |
|---|---|---|---|---|
hl | Enable highlighting. Set to true or 1 to enable. | boolean | false | No |
hl.fl | Comma-separated list of fields to highlight. Max 5 fields. | string | title,description | No |
hl.fragsize | Maximum size of each highlighted snippet in characters (50-500). | integer | 150 | No |
hl.snippets | Maximum number of snippets to return per field (1-10). | integer | 3 | No |
hl.tag.pre | Opening tag for highlighted terms. | string | <em> | No |
hl.tag.post | Closing tag for highlighted terms. | string | </em> | No |
Supported Highlight Fields
| Field | Description |
|---|---|
title | Article title |
description | Article description/summary |
body | Full article body text |
Response Format
When highlighting is enabled and matches are found, the response includes a highlighting object:
{
"status": "ok",
"results": [...],
"highlighting": {
"12345": {
"title": [
"Breaking: <em>Bitcoin</em> reaches new all-time high"
],
"description": [
"...The price of <em>Bitcoin</em> surged past $100,000 today, marking a historic milestone for the <em>cryptocurrency</em>..."
]
},
"12346": {
"title": [
"<em>Bitcoin</em> ETF approval drives market rally"
]
}
}
}The highlighting object is keyed by article ID, and each article contains arrays of highlighted snippets for the requested fields.
Workflow examples
Basic highlighting for search results:
curl "https://api.apitube.io/v1/news/everything?title=bitcoin&hl=true&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "bitcoin",
"hl": "true",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "bitcoin", "hl": "true", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "bitcoin", "hl" => "true", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "bitcoin")
q.Set("hl", "true")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=bitcoin&hl=true&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=bitcoin&hl=true
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersHighlighting with custom fields:
curl "https://api.apitube.io/v1/news/everything?title=artificial intelligence&hl=true&hl.fl=title,description,body&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "artificial intelligence",
"hl": "true",
"hl.fl": "title,description,body",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "artificial intelligence", "hl": "true", "hl.fl": "title,description,body", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "artificial intelligence", "hl" => "true", "hl.fl" => "title,description,body", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "artificial intelligence")
q.Set("hl", "true")
q.Set("hl.fl", "title,description,body")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=artificial intelligence&hl=true&hl.fl=title,description,body&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=artificial intelligence&hl=true&hl.fl=title,description,body
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersHighlighting with larger snippets:
curl "https://api.apitube.io/v1/news/everything?title=climate change&hl=true&hl.fragsize=300&hl.snippets=5&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "climate change",
"hl": "true",
"hl.fragsize": "300",
"hl.snippets": "5",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "climate change", "hl": "true", "hl.fragsize": "300", "hl.snippets": "5", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "climate change", "hl" => "true", "hl.fragsize" => "300", "hl.snippets" => "5", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "climate change")
q.Set("hl", "true")
q.Set("hl.fragsize", "300")
q.Set("hl.snippets", "5")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=climate change&hl=true&hl.fragsize=300&hl.snippets=5&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=climate change&hl=true&hl.fragsize=300&hl.snippets=5
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCustom highlight tags for HTML:
curl "https://api.apitube.io/v1/news/everything?title=Tesla&hl=true&hl.tag.pre=%3Cmark%3E&hl.tag.post=%3C%2Fmark%3E&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "Tesla",
"hl": "true",
"hl.tag.pre": "<mark>",
"hl.tag.post": "</mark>",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "Tesla", "hl": "true", "hl.tag.pre": "<mark>", "hl.tag.post": "</mark>", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "Tesla", "hl" => "true", "hl.tag.pre" => "<mark>", "hl.tag.post" => "</mark>", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "Tesla")
q.Set("hl", "true")
q.Set("hl.tag.pre", "<mark>")
q.Set("hl.tag.post", "</mark>")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=Tesla&hl=true&hl.tag.pre=%3Cmark%3E&hl.tag.post=%3C%2Fmark%3E&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=Tesla&hl=true&hl.tag.pre=%3Cmark%3E&hl.tag.post=%3C%2Fmark%3E
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCustom highlight tags for Markdown:
curl "https://api.apitube.io/v1/news/everything?title=SpaceX&hl=true&hl.tag.pre=%2A%2A&hl.tag.post=%2A%2A&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "SpaceX",
"hl": "true",
"hl.tag.pre": "**",
"hl.tag.post": "**",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "SpaceX", "hl": "true", "hl.tag.pre": "**", "hl.tag.post": "**", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "SpaceX", "hl" => "true", "hl.tag.pre" => "**", "hl.tag.post" => "**", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "SpaceX")
q.Set("hl", "true")
q.Set("hl.tag.pre", "**")
q.Set("hl.tag.post", "**")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=SpaceX&hl=true&hl.tag.pre=%2A%2A&hl.tag.post=%2A%2A&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=SpaceX&hl=true&hl.tag.pre=%2A%2A&hl.tag.post=%2A%2A
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersCombined with other filters:
curl "https://api.apitube.io/v1/news/everything?title=Apple&organization.name=Apple&hl=true&hl.fl=title,description&sentiment.overall.polarity=positive&published_at.start=2024-01-01&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "Apple",
"organization.name": "Apple",
"hl": "true",
"hl.fl": "title,description",
"sentiment.overall.polarity": "positive",
"published_at.start": "2024-01-01",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "Apple", "organization.name": "Apple", "hl": "true", "hl.fl": "title,description", "sentiment.overall.polarity": "positive", "published_at.start": "2024-01-01", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "Apple", "organization.name" => "Apple", "hl" => "true", "hl.fl" => "title,description", "sentiment.overall.polarity" => "positive", "published_at.start" => "2024-01-01", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "Apple")
q.Set("organization.name", "Apple")
q.Set("hl", "true")
q.Set("hl.fl", "title,description")
q.Set("sentiment.overall.polarity", "positive")
q.Set("published_at.start", "2024-01-01")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=Apple&organization.name=Apple&hl=true&hl.fl=title,description&sentiment.overall.polarity=positive&published_at.start=2024-01-01&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=Apple&organization.name=Apple&hl=true&hl.fl=title,description&sentiment.overall.polarity=positive&published_at.start=2024-01-01
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersHighlighting for entity search:
curl "https://api.apitube.io/v1/news/everything?person.name=Elon Musk&hl=true&hl.fl=title,body&hl.snippets=5&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"person.name": "Elon Musk",
"hl": "true",
"hl.fl": "title,body",
"hl.snippets": "5",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "person.name": "Elon Musk", "hl": "true", "hl.fl": "title,body", "hl.snippets": "5", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["person.name" => "Elon Musk", "hl" => "true", "hl.fl" => "title,body", "hl.snippets" => "5", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("person.name", "Elon Musk")
q.Set("hl", "true")
q.Set("hl.fl", "title,body")
q.Set("hl.snippets", "5")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?person.name=Elon Musk&hl=true&hl.fl=title,body&hl.snippets=5&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?person.name=Elon Musk&hl=true&hl.fl=title,body&hl.snippets=5
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersAutomatic term expansion with dictionary:
This example demonstrates how highlighting automatically expands search terms using synonyms and morphology. Searching for "innovation" will also highlight related terms like "innovative", "innovate", "innovator", etc.
curl "https://api.apitube.io/v1/news/everything?title=innovation&hl=true&hl.fl=title,description&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "innovation",
"hl": "true",
"hl.fl": "title,description",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "innovation", "hl": "true", "hl.fl": "title,description", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "innovation", "hl" => "true", "hl.fl" => "title,description", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "innovation")
q.Set("hl", "true")
q.Set("hl.fl", "title,description")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=innovation&hl=true&hl.fl=title,description&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=innovation&hl=true&hl.fl=title,description
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersResponse will highlight all morphological variations:
- "...driving innovation in technology..."
- "...most innovative companies..."
- "...continues to innovate..."
Building a search results page:
This example shows how to use highlighting with field selection for a search interface:
curl "https://api.apitube.io/v1/news/everything?title=AI&fl=id,title,description,published_at,source.name&hl=true&hl.fl=title,description&per_page=20&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"title": "AI",
"fl": "id,title,description,published_at,source.name",
"hl": "true",
"hl.fl": "title,description",
"per_page": "20",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "title": "AI", "fl": "id,title,description,published_at,source.name", "hl": "true", "hl.fl": "title,description", "per_page": "20", "api_key": "YOUR_API_KEY" });
const response = await fetch(`https://api.apitube.io/v1/news/everything?${params}`);
const data = await response.json();
console.log(data);$query = http_build_query(["title" => "AI", "fl" => "id,title,description,published_at,source.name", "hl" => "true", "hl.fl" => "title,description", "per_page" => "20", "api_key" => "YOUR_API_KEY"]);
$response = file_get_contents("https://api.apitube.io/v1/news/everything?$query");
$data = json_decode($response, true);
print_r($data);package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
u, _ := url.Parse("https://api.apitube.io/v1/news/everything")
q := u.Query()
q.Set("title", "AI")
q.Set("fl", "id,title,description,published_at,source.name")
q.Set("hl", "true")
q.Set("hl.fl", "title,description")
q.Set("per_page", "20")
q.Set("api_key", "YOUR_API_KEY")
u.RawQuery = q.Encode()
resp, _ := http.Get(u.String())
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var data map[string]any
json.Unmarshal(body, &data)
fmt.Println(data)
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.apitube.io/v1/news/everything?title=AI&fl=id,title,description,published_at,source.name&hl=true&hl.fl=title,description&per_page=20&api_key=YOUR_API_KEY"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}Write a script in your preferred language that calls the APITube News API:
GET https://api.apitube.io/v1/news/everything?title=AI&fl=id,title,description,published_at,source.name&hl=true&hl.fl=title,description&per_page=20
Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/parametersMore examples can be found on the News API Examples page.
Error Codes
For a complete reference of all API error codes, see the API Error Codes page.