---
title: "Sentiment analysis data"
description: "Sentiment analysis data from the web: review text with ratings, Reddit threads, YouTube comments and news, as clean JSON or Markdown for NLP models."
canonical: https://www.zenrows.com/use-cases/sentiment-analysis-data
updated: 2026-10-18
---

# Sentiment analysis data

Sentiment analysis data is opinionated text plus the context a model needs to score it, such as the text itself, a rating, date, source, language and its place in a thread. Zenrows collects it from review sites, forums, video comments and news pages through protected access, and returns clean JSON or Markdown ready for labeling and NLP training.

## Sample output: one labeled text record

```json
{
  "id": "rev_8f31c2",
  "source": "example-retailer.com",
  "source_type": "product_review",
  "url": "https://www.example-retailer.com/p/wireless-earbuds-x2/reviews",
  "entity": { "type": "product", "name": "Wireless Earbuds X2", "brand": "ExampleAudio" },
  "text": "Sound is great for the price, but the left bud drops connection every few minutes on calls.",
  "title": "Good sound, flaky connection",
  "rating": 3,
  "rating_scale": 5,
  "weak_label": "mixed",
  "aspects": ["sound_quality", "connectivity"],
  "language": "en",
  "market": "us",
  "created_at": "2026-10-11",
  "helpful_votes": 14,
  "verified_purchase": true,
  "author_id_hash": "a9c4e0d1",
  "collected_at": "2026-10-17T08:30:00Z"
}
```

An illustrative record: Zenrows returns the text, rating and dates from the page, and your pipeline adds `weak_label`, `aspects`, the language tag and the hashed author ID.

## Where sentiment analysis data comes from

Each source type gives you a different kind of opinion. Reviews come with a star rating you can use as a weak label, forums keep replies in thread order, and video comments give you short reactions in high volume.

| Job | Data you collect | Typical sources |
|---|---|---|
| Product review sentiment | Review text, star rating, date, verified flag, product ID | Amazon, Walmart, Best Buy, Trustpilot, G2, Bazaarvoice-hosted review pages |
| Local and hospitality sentiment | Review text, rating, location, owner reply | Google Maps, Yelp, TripAdvisor, Booking.com |
| Community opinion | Post and comment text, score, thread position, parent comment | Reddit, Hacker News, Stack Exchange, product forums |
| Video comment sentiment | Comment text, likes, reply count, timestamp, video | YouTube, TikTok public pages |
| News and editorial tone | Article text, headline, publisher, date, reader comments | News sites, Substack, industry publications |
| Market and investor sentiment | Posts and headlines that mention a ticker or company | Investing communities on Reddit, financial news sites |

## Why sentiment datasets go wrong

Most errors in a sentiment model trace back to how the text was collected. Each problem below skews what the model learns.

| What breaks | What it looks like | How Zenrows handles it |
|---|---|---|
| Reviews behind "load more" | You get the first 10 reviews per product, all of them the most helpful and most positive | Page actions click "load more" or scroll before the page is returned |
| Protected review sites | Large review sites and retailers return challenge pages, so whole sources go missing | Zenrows' stealth gets through Cloudflare, DataDome, Akamai and similar protections |
| Boilerplate in the text | Cookie banners, menus and "Read more" fragments end up in the text you score | Name the review fields with CSS selectors to get only those, and Markdown output strips page chrome from threads |
| Replies without context | A reply such as "same here" is scored with no idea what it agrees with | Fetch the whole thread as Markdown and keep each comment's parent |
| One language, one market | Sites show reviews in the visitor's language, so your set is all English | Geotargeting collects each market's reviews as local visitors see them |
| Training-set volume | Hundreds of thousands of pages to collect for a single model | Batch runs the full URL list as one job |

## How to build a sentiment analysis dataset

1. **Choose sources per label type.** Use review sites where a rating gives you a weak label, and forums or comments where you will label by hand or with a model.
2. **Collect past the first page.** Click through "load more" and pagination so negative and recent reviews are in the set.
3. **Keep the metadata.** Store source, date, rating, market and thread position next to every text, and hash author names.
4. **Clean, deduplicate and balance.** Drop near-duplicate texts, check the rating mix per source, and split train and test sets by time.

```python Python
# pip install requests
import json
import requests

params = {
    "apikey": "YOUR_ZENROWS_API_KEY",
    "url": REVIEWS_URL,  # a product's review page
    "js_render": "true",
    "premium_proxy": "true",
    "js_instructions": json.dumps([
        {"click": "button.load-more-reviews"},
        {"wait": 1500},
        {"click": "button.load-more-reviews"},
        {"wait": 1500},
    ]),
    "css_extractor": json.dumps({
        "texts": ".review-body",
        "ratings": ".review-rating @aria-label",
        "dates": ".review-date",
    }),
}
response = requests.get("https://api.zenrows.com/v1/", params=params)
print(response.json())  # selectors are illustrative; match them to the site
```

```bash cURL
# Forum threads as Markdown, one Batch job for the whole list
curl -X POST "https://async.api.zenrows.com/v1/jobs" \
  -H "X-API-Key: YOUR_ZENROWS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "regular",
    "status": "closed",
    "zenrows_params": { "mode": "auto", "response_type": "markdown" },
    "tasks": [
      { "url": "THREAD_URL_1", "external_id": "thread-1" },
      { "url": "THREAD_URL_2", "external_id": "thread-2" }
    ]
  }'
```

```bash CLI
npx -y @zenrows/cli init
# Check how clean a thread's text is before you scale up
zenrows fetch THREAD_URL --output markdown
# Then run the whole thread list: one {"url": "..."} per line
zenrows batch create threads.jsonl --wait
zenrows batch results JOB_ID --out thread-text.jsonl
```

```text Claude Code (MCP)
# Connect once
claude mcp add zenrows -e ZENROWS_API_KEY=YOUR_ZENROWS_API_KEY -- npx -y @zenrows/mcp

# Then ask:
Use Zenrows to collect every review on this Trustpilot company page, following the pagination, and return JSON with the review text, star rating, date and country for each one, without reviewer names.
```

## Which Zenrows product fits

| If you need to | Use | Why |
|---|---|---|
| Pull reviews with their ratings and dates | [Fetch](/products/fetch) | Page actions load every review, and CSS selectors return them as fields |
| Collect hundreds of thousands of threads or review pages | [Batch](/products/batch) | One job for the whole list, with Markdown output for text |
| Find every thread in a forum section | [Crawl](/products/crawl) | Follows pagination and keeps only thread URLs that match your pattern |
| Inspect a source's text quickly | [CLI](/cli) | `fetch` with Markdown output shows exactly what your model will read |

## What success looks like

| Measure | What good looks like | How to check it |
|---|---|---|
| Review depth | You hold all of a product's reviews | Compare stored reviews per product with the count the page shows |
| Text cleanliness | No navigation, banner or button text inside records | Search the dataset for known boilerplate strings per source |
| Duplicate rate | Each opinion appears once, even when syndicated across sites | Near-duplicate match on text, per source and across sources |
| Label balance | Every rating level is represented in each source | Rating distribution per source, before and after sampling |
| Language accuracy | The detected language of each text matches its market | Run a language detector and compare with the `market` field |
| Time coverage | Every source has records for every week in your window | Count records per source per week and flag gaps |

## Sentiment analysis data FAQ

### What is sentiment analysis data?

It is text that carries an opinion, collected with enough context to score it: the text, where it came from, when it was written, the product or brand it is about, and any rating that comes with it. Reviews, forum posts, video comments and news articles are the most common sources for training and evaluating sentiment models.

### Can I use star ratings as sentiment labels?

Star ratings make good weak labels: 1 and 2 stars as negative, 4 and 5 as positive, 3 as mixed. They are noisy, since a 4-star review can complain at length, so hand-label a sample to measure the noise and keep a human-labeled test set. Forum and comment text has no rating and needs labeling.

### Is it legal to scrape data for sentiment analysis?

Reviews and public posts are widely used for research and product analytics, but they are written by people, so treat usernames and anything identifying as personal data under GDPR or CCPA. Hash or drop author names, follow each site's terms, and avoid republishing full texts. Ask your legal team about your specific use.

### How do I scrape reviews that load with a "load more" button?

Render the page in a full browser and add page actions that click the button and wait, repeated as many times as you need. Name the review text, rating and date with CSS selectors to get back only those fields. For pages that load reviews from an internal API, capture the page's background network calls (XHR) and read that JSON.

### How should I prepare scraped text for an NLP model?

Keep the text as plain sentences or Markdown, without HTML. Normalize whitespace and emoji consistently, tag the language, drop near-duplicates, and keep metadata in separate fields rather than inside the text. Split train and test sets by date or by product, so the model is tested on opinions it has not seen.

### How big should a sentiment analysis dataset be?

Size it by labels, not pages. For fine-tuning a classifier, a smaller hand-checked set per class is often worth more than a much larger weakly labeled one. Collect broadly, then sample so every rating level, source and month is represented, and keep a held-out test set from a later time window so the score reflects new opinions.

### Can I collect sentiment data in several languages?

Yes. Use geotargeting to send each request from the market you want, such as Germany, Spain or Japan, so review sites return local reviews in the local language. Store the market and the detected language with each record so you can train one model per language or a multilingual one.

## Related use cases

- [Review scraping](https://www.zenrows.com/use-cases/review-scraping.md): Review text, ratings, dates and replies from Amazon, Google, Yelp, Trustpilot and G2, every page.
- [Social media scraping](https://www.zenrows.com/use-cases/social-media-scraping.md): Public posts, profiles, comments and engagement from Reddit, YouTube, TikTok and X, as structured JSON.
- [Brand monitoring](https://www.zenrows.com/use-cases/brand-monitoring.md): Every mention of your brand in news, forums, reviews and search, as clean text for sentiment and alerts.
- [News scraping](https://www.zenrows.com/use-cases/news-scraping.md): Full-text articles, headlines, bylines and dates from publishers, Google News and wires, as clean Markdown or JSON.
- [Chatbot training data](https://www.zenrows.com/use-cases/chatbot-training-data.md): Your website, help center and docs as clean Markdown for a chatbot knowledge base, refreshed on schedule.

Start free: https://app.zenrows.com/register. Docs: https://docs.zenrows.com
