Entity Query Examples
Getting news about a specific entity
This query retrieves news articles about a specific entity by ID.
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/parametersFiltering an entity by its sentiment
Entity-level sentiment scores the tone expressed toward a specific entity inside each article, independently of the document's overall sentiment. Combine an entity selector with entity.sentiment.polarity (or entity.sentiment.score.min / entity.sentiment.score.max) to retrieve, for example, only the articles where a given company is mentioned negatively — the classic financial/PR monitoring query.
Each entity in the response also carries a sentiment object (score, polarity, and per-mention mentions counts).
curl "https://api.apitube.io/v1/news/everything?entity.id=1278268&entity.sentiment.polarity=negative&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"entity.id": "1278268",
"entity.sentiment.polarity": "negative",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1278268", "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" => "1278268", "entity.sentiment.polarity" => "negative", "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("entity.sentiment.polarity", "negative")
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&entity.sentiment.polarity=negative&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&entity.sentiment.polarity=negative
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/parametersGetting news about multiple entities
This query retrieves news articles about multiple entities.
curl "https://api.apitube.io/v1/news/everything?entity.id=1278268,1309610&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"entity.id": "1278268,1309610",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1278268,1309610", "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,1309610", "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,1309610")
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,1309610&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,1309610
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/parametersFiltering by including and excluding entities
This query retrieves articles about one entity and excludes another.
curl "https://api.apitube.io/v1/news/everything?entity.id=1278268&ignore.entity.id=1309610&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"entity.id": "1278268",
"ignore.entity.id": "1309610",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1278268", "ignore.entity.id": "1309610", "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" => "1309610", "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", "1309610")
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=1309610&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=1309610
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
This query analyzes correlation between multiple entities, sorting by sentiment score.
curl "https://api.apitube.io/v1/news/everything?entity.id=1278268,1333257&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,1333257",
"sort.by": "sentiment.overall.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1278268,1333257", "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,1333257", "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,1333257")
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,1333257&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,1333257&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/parametersTracking entity mentions over time
This query allows tracking mentions of a specific entity in chronological order.
curl "https://api.apitube.io/v1/news/everything?entity.id=1309610&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": "1309610",
"per_page": "100",
"sort.by": "published_at",
"sort.order": "asc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1309610", "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" => "1309610", "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", "1309610")
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=1309610&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=1309610&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 impact on market sentiment
This query analyzes entity influence on market sentiment in the business category.
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&sentiment.overall.polarity=positive&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:04000000",
"sentiment.overall.polarity": "positive",
"sort.by": "sentiment.overall.score",
"sort.order": "desc",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "category.id": "medtop:04000000", "sentiment.overall.polarity": "positive", "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:04000000", "sentiment.overall.polarity" => "positive", "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:04000000")
q.Set("sentiment.overall.polarity", "positive")
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:04000000&sentiment.overall.polarity=positive&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:04000000&sentiment.overall.polarity=positive&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-lingual entity reputation tracking
This query tracks how a specific entity is perceived across different languages.
curl "https://api.apitube.io/v1/news/everything?entity.id=1309610&language.code=en,fr,de&sort.by=language.code,sentiment.overall.score&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"entity.id": "1309610",
"language.code": "en,fr,de",
"sort.by": "language.code,sentiment.overall.score",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1309610", "language.code": "en,fr,de", "sort.by": "language.code,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(["entity.id" => "1309610", "language.code" => "en,fr,de", "sort.by" => "language.code,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("entity.id", "1309610")
q.Set("language.code", "en,fr,de")
q.Set("sort.by", "language.code,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?entity.id=1309610&language.code=en,fr,de&sort.by=language.code,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?entity.id=1309610&language.code=en,fr,de&sort.by=language.code,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/parametersMulti-entity competitive analysis with media richness
This query compares multiple competing entities with requirements for visual content and source authority, focusing on recent innovation coverage.
curl "https://api.apitube.io/v1/news/everything?entity.id=1278268,1309610,1333257&title=innovation,technology,development&media.images.count=1&sort.by=entity.id,published_at&api_key=YOUR_API_KEY"import requests
response = requests.get(
"https://api.apitube.io/v1/news/everything",
params={
"entity.id": "1278268,1309610,1333257",
"title": "innovation,technology,development",
"media.images.count": "1",
"sort.by": "entity.id,published_at",
"api_key": "YOUR_API_KEY",
},
)
print(response.json())const params = new URLSearchParams({ "entity.id": "1278268,1309610,1333257", "title": "innovation,technology,development", "media.images.count": "1", "sort.by": "entity.id,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,1309610,1333257", "title" => "innovation,technology,development", "media.images.count" => "1", "sort.by" => "entity.id,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,1309610,1333257")
q.Set("title", "innovation,technology,development")
q.Set("media.images.count", "1")
q.Set("sort.by", "entity.id,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,1309610,1333257&title=innovation,technology,development&media.images.count=1&sort.by=entity.id,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,1309610,1333257&title=innovation,technology,development&media.images.count=1&sort.by=entity.id,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/parameters