APITube Help Center

How to Forecast Social Trends from News

Spot rising social topics early with /v1/news/trends — trending scores, period-over-period change and time_bucket series

Tasha Tatum

Written by Tasha Tatum

July 4, 2026

Open this example in the API Playground ↗

How to forecast social trends from news

To forecast social trends from news, call the /v1/news/trends endpoint over a society slice of coverage and read its momentum signals. APITube does not predict the future for you — it tells you which topics, entities and categories are rising right now, so you can spot a social trend while it is still building instead of after it peaks. Add trending=true for a per-value trending score, compare=true for period-over-period change, or time_bucket for a day-by-day series, then narrow the set with the same filters you would use on /v1/news/everything. This ranks the fastest-moving entities in society coverage over the last 30 days:

curl "https://api.apitube.io/v1/news/trends?field=entity.id&category.id=medtop:14000000&trending=true&api_key=YOUR_API_KEY"

You can pass the key as the api_key query parameter or as an X-API-Key header, and call the endpoint with GET (filters as query parameters) or POST (filters as a JSON body). The category.id=medtop:14000000 code is the IPTC top-level society category, so the ranking covers only articles the pipeline tagged as society news.

Popularity and momentum are different questions: a topic can be large but flat. Add trending=true to compute a trending score for each value — the ratio of its recent 2-day average to its trailing 14-day average, so a score above 1 means the trend is rising and below 1 means it is fading. Each value also comes back with trending_history, the daily counts behind the score. Tune the look-back window with trending_days (default 14, allowed range 7 to 30). Trend on entity.id to watch people and organizations, topic.id for subject tags, or category.id for broad IPTC sections:

curl "https://api.apitube.io/v1/news/trends?field=topic.id&category.id=medtop:07000000&trending=true&trending_days=7&api_key=YOUR_API_KEY"

Here medtop:07000000 is the health category, so a 7-day trending window surfaces which health subjects are gaining coverage fastest this week — an early read on an emerging social conversation.

How do you tell whether a social topic is growing or fading?

To measure direction, use compare=true with a compare_window. The endpoint counts each value in your current window, then counts the same window shifted back by compare_window, and returns the difference as previous_count, change_absolute and change_percent. A value that had zero articles in the previous period but appears now is reported as change_percent of 100, which flags a genuinely new trend. Add sort=change to rank the biggest movers first (this sort mode is only available when compare=true):

curl "https://api.apitube.io/v1/news/trends?field=entity.id&category.id=medtop:14000000&published_at.start=NOW-7DAYS&compare=true&compare_window=7DAYS&sort=change&api_key=YOUR_API_KEY"

compare_window is required whenever compare=true; omitting it returns error ER0352. It accepts the same relative-duration formats as the date filters — 24HOURS, 7DAYS, 1WEEK, or short aliases like 1w and 2m — and the shift is clamped between 1 hour and 1 year. Set compare_window=1YEAR to compare this week against the same week last year. The mechanics are covered in full in how to compare news trends between two periods.

How do you chart a social trend day by day?

To see the shape of a trend rather than a single delta, use time_bucket. Set it to hour, day, week or month, and each value returns a buckets map of counts per interval plus a total, ordered by total descending. A rising curve across the buckets is your leading indicator:

curl "https://api.apitube.io/v1/news/trends?field=category.id&published_at.start=NOW-14DAYS&time_bucket=day&api_key=YOUR_API_KEY"

In time_bucket mode the value is the raw id and is not enriched with a name. Use compare when you want one period-over-period number and time_bucket when you want the day-by-day curve; run them as separate requests rather than combining the two in one call.

Trends are computed over exactly the articles your filters select, so every standard search filter works here too. To scope a social-trends study, combine an IPTC category with a language and a date window. The society-related IPTC codes include society (medtop:14000000), health (medtop:07000000) and science and technology (medtop:13000000); you can pass up to three category codes, comma-separated, and they combine with OR. For a precise subject instead of a broad section, use topic.id (a named subject tag such as industry.crypto_news, up to three with OR logic):

curl "https://api.apitube.io/v1/news/trends?field=entity.id&category.id=medtop:14000000&language.code=en&published_at.start=NOW-30DAYS&api_key=YOUR_API_KEY"

Every code is checked against the categories and topics APITube already tracks: an unknown category.id returns ER0206 and an unknown topic.id returns ER0208, and the whole request stops on the first bad value. See how to filter news by category for the full IPTC rules.

How do you track the mood behind a social trend?

A rising trend is often about tone, not just volume. Because the trends endpoint runs the shared filter chain, add sentiment.overall.polarity to restrict the ranking to articles the pipeline scored a certain way. It accepts positive, negative or neutral, so you can surface which entities are driving negative social coverage as it climbs:

curl "https://api.apitube.io/v1/news/trends?field=entity.id&category.id=medtop:14000000&sentiment.overall.polarity=negative&trending=true&api_key=YOUR_API_KEY"

Reading the trending score alongside a negative-sentiment filter tells you not only that a social topic is rising, but that it is rising in a critical direction — the kind of early signal a reputation, policy or public-health team wants first.

The field parameter is required (missing or invalid returns ER0350) and accepts up to five comma-separated values. The current window is capped at 30 days and defaults to the last 30 days if you pass no dates — a wider range returns ER0353. per_page defaults to 10 and maxes out at 100. Each /v1/news/trends call costs 1 point, no matter how many fields you aggregate. On a test key the structure and counts come back, but every trend value is replaced with the placeholder [Upgrade subscription plan], so switch to a live key to read real entity and category values. The usual limits apply: ER0176 (HTTP 402) when your account has no points, and ER0203 (HTTP 429) when you exceed 50 requests per minute on a live key (15 on a test key), with repeated violations triggering a temporary ban (ER0204). For the complete field and response reference, see how to discover trending topics and entities and the official News API parameters reference.

Common Questions

No. The /v1/news/trends endpoint does not forecast the future — it measures momentum in the news that already exists. The trending score (recent volume versus the trailing window), compare change (change_percent versus a shifted period) and time_bucket series are leading indicators: you build the forecast by acting on a trend while it is still rising. Treat a trending_score above 1 or a large positive change_percent as “this is accelerating,” not as a guaranteed prediction.

Use field=entity.id to track which people and organizations are gaining coverage, field=topic.id for named subject tags, and field=category.id for broad IPTC sections such as society (medtop:14000000) or health (medtop:07000000). You can aggregate up to five fields in one call by passing them comma-separated, for example field=entity.id,topic.id, to power an entity list and a topic breakdown from a single request.

The current window you measure is capped at 30 days and defaults to the last 30 days when you pass no dates; a wider published_at range returns ER0353, so split longer studies into 30-day chunks. The compare_window offset is separate from that cap and can reach up to a year back, so you can keep a 7-day current window and still compare it against the same week a year ago.

Why are my trend values masked?

If every trend value reads [Upgrade subscription plan], you are calling /v1/news/trends with a test key. Test keys return the real structure, counts and percentages so you can build against the shape of the response, but they hide the underlying entity, topic and category values. Switch to a live key to see the real social trends.


Related Articles