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": "medtop:04000000",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&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=medtop:13000000&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=medtop:11000000&language=fr&api_key=YOUR_API_KEY"

Time-based category analysis

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

python
params = {
    "category.id": "medtop:07000000",
    "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=medtop:07000000&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": "medtop:15000000",
    "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=medtop:15000000&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": "medtop:04000000,medtop:20000349",
    "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=medtop:04000000,medtop:20000349&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": "medtop:15000000",
    "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=medtop:15000000&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": "medtop:13000000",
    "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=medtop:13000000&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"