Skip to content

Sorting Query Examples

Sort by publication date in ascending order

This query retrieves news articles sorted by publication date from oldest to newest.

python
params = {
    "sort.by": "published_at",
    "sort.order": "asc",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"

Sort by sentiment score in descending order

This query retrieves news articles sorted by sentiment score from highest (most positive) to lowest.

python
params = {
    "sort.by": "sentiment.overall.score",
    "sort.order": "desc",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"

Multi-dimensional content ranking

This query ranks technology articles from high-quality sources by sentiment score.

python
params = {
    "category.id": "medtop:13000000",
    "sort.by": "sentiment.overall.score",
    "sort.order": "desc",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?category.id=medtop:13000000&sort.by=sentiment.overall.score&sort.order=desc&api_key=YOUR_API_KEY"

Media-rich content prioritization

This query prioritizes articles with the most images in technology and sports categories.

python
params = {
    "media.images.count": "1",
    "sort.by": "media.images.count",
    "sort.order": "desc",
    "category.id": "medtop:13000000,medtop:15000000",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?media.images.count=1&sort.by=media.images.count&sort.order=desc&category.id=medtop:13000000,medtop:15000000&api_key=YOUR_API_KEY"

Chronological event analysis

This query analyzes news about elections in chronological order.

python
params = {
    "title": "election",
    "category.id": "medtop:11000000",
    "sort.by": "published_at",
    "sort.order": "asc",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?title=election&category.id=medtop:11000000&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"

Source quality ranking

This query ranks articles about AI by source quality.

python
params = {
    "title": "artificial intelligence",
    "category.id": "medtop:13000000",
    "sort.by": "source.rank.opr",
    "sort.order": "desc",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?title=artificial%20intelligence&category.id=medtop:13000000&sort.by=source.rank.opr&sort.order=desc&api_key=YOUR_API_KEY"

Sentiment evolution tracking

This query tracks how sentiment about green energy has evolved over time.

python
params = {
    "topic.id": "industry.green_energy_news",
    "sort.by": "published_at",
    "sort.order": "asc",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?topic.id=industry.green_energy_news&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"

Multi-faceted organization perception sorting

This query sorts coverage of multiple competing organizations across different parameters simultaneously to create a comprehensive comparison.

python
params = {
    "organization.name": "Tesla,Google,Microsoft,Amazon",
    "category.id": "medtop:04000000",
    "sort.by": "organization.name,sentiment.overall.score,source.rank.opr",
    "sort.order": "desc",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?organization.name=Tesla,Google,Microsoft,Amazon&category.id=medtop:04000000&sort.by=organization.name,sentiment.overall.score,source.rank.opr&sort.order=desc&api_key=YOUR_API_KEY"

Hierarchical regional news prioritization

This query implements complex sorting to organize news by geographical regions, then by topic importance, and finally by publication recency.

python
params = {
    "source.country.code": "us,gb,de,fr",
    "category.id": "medtop:11000000",
    "title": "climate,energy,sustainability",
    "sort.by": "source.country.code,category.id,published_at",
    "sort.order": "asc,desc,desc",
    "api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?source.country.code=us,gb,de,fr&category.id=medtop:11000000&title=climate,energy,sustainability&sort.by=source.country.code,category.id,published_at&sort.order=asc,desc,desc&api_key=YOUR_API_KEY"