Skip to content

Category Query Examples

Getting news from a specific category

This query retrieves news articles from the "business" category.

python
params = {
    "category.id": "2",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=2&api_key=YOUR_API_KEY"

Getting technology news

This query retrieves news articles from the "technology" category.

python
params = {
    "category.id": "4",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=4&api_key=YOUR_API_KEY"

Filtering news by category and language

This query retrieves political news in French.

python
params = {
    "category.id": "3",
    "language": "fr",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=3&language=fr&api_key=YOUR_API_KEY"

Cross-taxonomy category filtering

This query retrieves articles matching categories from different taxonomies.

python
params = {
    "category.id": "4",
    "category.taxonomy": "iptc,iab",
    "sentiment.overall.polarity": "positive",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=4&category.taxonomy=iptc,iab&sentiment.overall.polarity=positive&api_key=YOUR_API_KEY"

Time-based category analysis

This query allows for time-based analysis of articles in the "finance" category over a specific period.

python
params = {
    "category.id": "6",
    "published_at.start": "2023-01-01",
    "published_at.end": "2023-12-31",
    "sort.by": "published_at",
    "sort.order": "asc",
    "per_page": "100",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=6&published_at.start=2023-01-01&published_at.end=2023-12-31&sort.by=published_at&sort.order=asc&per_page=100&api_key=YOUR_API_KEY"

Category-based media analysis

This query analyzes sports news with a large number of images.

python
params = {
    "category.id": "7",
    "media.images.count": "3",
    "source.rank.opr.min": "0.7",
    "published_at.start": "2023-01-01",
    "sort.by": "media.images.count",
    "sort.order": "desc",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=7&media.images.count=3&source.rank.opr.min=0.7&published_at.start=2023-01-01&sort.by=media.images.count&sort.order=desc&api_key=YOUR_API_KEY"

Comparing sentiment across different categories

This query compares positive sentiment across multiple categories.

python
params = {
    "category.id": "2,3,4",
    "sentiment.overall.polarity": "positive",
    "published_at.start": "2023-01-01",
    "published_at.end": "2023-12-31",
    "sort.by": "category.id",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=2,3,4&sentiment.overall.polarity=positive&published_at.start=2023-01-01&published_at.end=2023-12-31&sort.by=category.id&api_key=YOUR_API_KEY"

Category and location correlation analysis

This query analyzes how entertainment news varies across different geographic regions.

python
params = {
    "category.id": "8",
    "location.name": "Los Angeles,New York,London,Mumbai,Tokyo",
    "published_at.start": "2023-01-01",
    "sort.by": "location.name",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=8&location.name=Los%20Angeles,New%20York,London,Mumbai,Tokyo&published_at.start=2023-01-01&sort.by=location.name&api_key=YOUR_API_KEY"

Multi-category emerging trend identification

This query identifies emerging trends across technology, science, and health categories with positive sentiment.

python
params = {
    "category.id": "4,15,11",
    "title_pattern": "emerging|breakthrough|revolutionary",
    "sentiment.overall.polarity": "positive",
    "published_at.start": "2023-01-01",
    "sort.by": "published_at",
    "sort.order": "desc",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=4,15,11&title_pattern=emerging|breakthrough|revolutionary&sentiment.overall.polarity=positive&published_at.start=2023-01-01&sort.by=published_at&sort.order=desc&api_key=YOUR_API_KEY"