Date and Time Query Examples
Getting news in a specific date range
This query retrieves news articles published in January 2022.
python
params = {
"published_at.start": "2022-01-01",
"published_at.end": "2022-01-31",
"api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?published_at.start=2022-01-01&published_at.end=2022-01-31&api_key=YOUR_API_KEY"
Using relative time ranges
This query demonstrates using different date formats to retrieve news.
python
params = {
"published_at.start": "2025-01-02",
"published_at.end": "2006-01-04",
"api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?published_at.start=2025-01-02&published_at.end=2006-01-04&api_key=YOUR_API_KEY"
Historical event coverage analysis
This query tracks the chronology of coverage of Barack Obama's election victory.
python
params = {
"person.name": "Barack Obama",
"published_at.start": "2008-11-04",
"published_at.end": "2008-11-11",
"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?person.name=Barack%20Obama&published_at.start=2008-11-04&published_at.end=2008-11-11&sort.by=published_at&sort.order=asc&per_page=100&api_key=YOUR_API_KEY"
Precise time analysis using timestamps
This query analyzes news about the Federal Reserve within 24 hours after an important announcement.
python
params = {
"organization.name": "Federal Reserve",
"published_at.start": "2023-03-21T14:00:00Z",
"published_at.end": "2023-03-22T14:00:00Z",
"sort.by": "published_at",
"sort.order": "asc",
"api_key": "YOUR_API_KEY"
}
shell
curl -X GET "https://api.apitube.io/v1/news/everything?organization.name=Federal%20Reserve&published_at.start=2023-03-21T14:00:00Z&published_at.end=2023-03-22T14:00:00Z&sort.by=published_at&sort.order=asc&api_key=YOUR_API_KEY"