How to track stock-market sentiment
Measure the tone of finance coverage and gauge sentiment toward a company with polarity filters and sentiment sorting
Written by Tasha Tatum
July 2, 2026
Updated July 6, 2026
How to track stock-market sentiment
To track stock-market sentiment, query /v1/news/everything, scope the results to finance coverage with category.id=medtop:04000000, and read tone with the sentiment.overall.polarity filter or by sorting on sort.by=sentiment.overall.score. Every article APITube returns already carries a sentiment score, so you never compute tone yourself — you filter and sort on a value the API attaches during processing.
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&sentiment.overall.polarity=negative&sort.by=sentiment.overall.score&sort.order=asc&per_page=50" \
-H "X-API-Key: YOUR_API_KEY"
You can pass the key as the api_key query parameter or as an X-API-Key header. The medtop:04000000 code is the IPTC category for economy, business and finance, so it keeps market coverage in and general news out.
How do you gauge the market’s overall mood?
The fastest read on the market is the share of positive versus negative coverage in the finance category. Filter by tone with sentiment.overall.polarity, which accepts positive, negative or neutral (case-insensitive) and keeps only articles that match:
# Positive finance coverage, newest first
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&sentiment.overall.polarity=positive&language.code=en" \
-H "X-API-Key: YOUR_API_KEY"
To rank by how strong the tone is rather than filter, sort with sort.by=sentiment.overall.score. Scores run from -1 (most negative) to 1 (most positive), so sort.order=asc surfaces the most negative market stories first and sort.order=desc the most positive. Results are sorted by published_at (newest first) by default, so set sort.by explicitly when you want a tone ranking.
How do you measure sentiment toward one company or stock?
Article-level polarity describes the whole story, which can bury how a single ticker is treated inside a broader piece. To measure tone toward one company specifically, pin the company with organization.name (or a numeric entity.id) and add entity.sentiment.polarity:
# Coverage that speaks negatively about Tesla, not just negative articles that mention it
curl "https://api.apitube.io/v1/news/everything?organization.name=Tesla&entity.sentiment.polarity=negative" \
-H "X-API-Key: YOUR_API_KEY"
entity.sentiment.polarity accepts positive, negative or neutral, and entity.sentiment.score.min / entity.sentiment.score.max bracket the same -1 to 1 scale for the entity alone. This scores each mention of the company separately from the article as a whole, so you catch a wave of negative sentiment about one stock even when the surrounding market piece is neutral. See how to get sentiment toward a specific company or person for the full entity-level parameters. If organization.name returns a not found error, look up the exact entity with autocomplete first — how to find news mentioning a person or company covers resolving names to a stable entity.id.
How do you score sentiment on a numeric scale?
Polarity answers “good, bad or flat?”, but a trading signal usually needs a threshold. Every sentiment layer is also scored from -1 to 1, and sentiment.overall.score.min / sentiment.overall.score.max bound that range. This returns only strongly negative finance coverage — useful for an early-warning feed:
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&sentiment.overall.score.max=-0.5" \
-H "X-API-Key: YOUR_API_KEY"
A value outside -1 to 1, or a non-numeric value, returns HTTP 400 with a sentiment validation error, so keep thresholds inside that band. The same -1..1 band applies to entity.sentiment.score.*, so you can set a hard cut-off on company-level tone the same way.
How do you bound the window and pull enough articles?
Sentiment is only meaningful over a defined period, so bound the window with published_at.start and published_at.end. They accept absolute dates (2026-06-01) and relative Solr-style values such as NOW-7DAY, NOW-1WEEK or NOW-1MONTH:
# Last 7 days of negative finance coverage, 250 per page
curl "https://api.apitube.io/v1/news/everything?category.id=medtop:04000000&sentiment.overall.polarity=negative&published_at.start=NOW-7DAY&per_page=250" \
-H "X-API-Key: YOUR_API_KEY"
per_page defaults to 100 and maxes out at 250 (a larger value returns an out-of-range error); walk further with page. On the Free plan, paging stops after the first 5 pages, so use a paid plan when you need deep result sets for a sentiment average.
How do you track sentiment shifts in real time?
For a live tone feed, keep the same filters but open the SSE stream at /v1/news/stream instead of polling everything. The stream pushes new matching articles as they are published and supports Last-Event-Id so you can resume without gaps:
curl -N "https://api.apitube.io/v1/news/stream?category.id=medtop:04000000&sentiment.overall.polarity=negative&language.code=en" \
-H "X-API-Key: YOUR_API_KEY"
See how to stream news in real time with SSE for handling the event stream. The canonical parameter list lives in the News API parameters reference.
Common Questions
- Do I need a special finance or markets endpoint?
- What is the difference between article and entity sentiment?
- Why does organization.name say the company was not found?
- How do I sort by the strongest negative coverage?
Do I need a special finance or markets endpoint?
No. Stock-market sentiment uses the same /v1/news/everything endpoint and the same sentiment.*, entity.sentiment.*, category.id, published_at and sort.by filters as any other topic. You scope to finance with category.id=medtop:04000000 and read tone with the sentiment parameters — there is no separate markets route.
What is the difference between article and entity sentiment?
sentiment.overall.polarity and sentiment.overall.score describe the tone of the whole article. entity.sentiment.polarity and entity.sentiment.score.* describe the tone toward a single mentioned thing — a company, person or brand — scored independently of the surrounding text. Use article sentiment for the market’s overall mood and entity sentiment when you care about one ticker. See how to filter news by sentiment for the article-level parameters.
Why does organization.name say the company was not found?
organization.name resolves the name to a known entity before filtering, and an unrecognized name returns an HTTP 400 error. Resolve the company to a stable numeric entity.id with entity autocomplete, then filter by entity.id instead — ids do not depend on exact spelling or capitalization, so they avoid the not-found case.
How do I sort by the strongest negative coverage?
Set sort.by=sentiment.overall.score and sort.order=asc. Because the score runs from -1 (most negative) to 1 (most positive), ascending order returns the most negative articles first. Combine it with category.id=medtop:04000000 to keep the ranking inside finance coverage.