---
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: the text, a rating, date, source, language and its place in a thread. Zenrows collects it from review sites, forums, video comments and news pages past their protection, and returns clean JSON or Markdown 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"
}
```

Illustrative: Zenrows returns text, rating and dates; your pipeline adds `weak_label`, `aspects`, the language tag and the hashed author ID.

## Where sentiment analysis data comes from

Reviews bring a star rating for weak labels; forums keep thread order; video comments give short reactions in volume.

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

## Why sentiment datasets go wrong

Most sentiment model errors trace back to collection. Each problem below skews what the model learns.

| What breaks | What it looks like | How Zenrows handles it |
|---|---|---|
| Reviews behind "load more" | Only the first 10 reviews, the most helpful and positive | Page actions click "load more" or scroll first |
| Protected review sites | Challenge pages; whole sources go missing | Zenrows' stealth gets through Cloudflare, DataDome, Akamai and similar |
| Boilerplate in the text | Banners, menus and "Read more" in the scored text | CSS selectors return only review fields; Markdown strips page chrome from threads |
| Replies without context | "Same here" scored without what it agrees with | Fetch the whole thread as Markdown, keep each parent |
| One language, one market | Reviews in the visitor's language: an all-English set | Geotargeting collects each market as locals see it |
| Training-set volume | Hundreds of thousands of pages per model | Batch runs the full list as one job |

## How to build a sentiment analysis dataset

1. **Choose sources per label type**: rated reviews for weak labels, forums and comments to label by hand or model.
2. **Collect past the first page** through "load more" and pagination, so negative and recent reviews get in.
3. **Keep the metadata**: source, date, rating, market, thread position; hash author names.
4. **Clean, deduplicate and balance**: drop near-duplicates, check rating mix per source, split train and test 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; CSS selectors return the fields |
| Collect hundreds of thousands of threads or reviews | [Batch](/products/batch) | One job for the list, Markdown for text |
| Find every thread in a forum section | [Crawl](/products/crawl) | Follows pagination, keeps thread URLs matching your pattern |
| Inspect a source's text quickly | [CLI](/cli) | `fetch` with Markdown shows what your model will read |

## What success looks like

| Measure | What good looks like | How to check it |
|---|---|---|
| Review depth | All of a product's reviews | Stored reviews against the page count |
| Text cleanliness | No navigation, banner or button text | Search for known boilerplate per source |
| Duplicate rate | Each opinion once, even when syndicated | Near-duplicate match within and across sources |
| Label balance | Every rating level in each source | Rating distribution per source, before and after sampling |
| Language accuracy | Detected language matches the market | Language detector against the `market` field |
| Time coverage | Records every week, for every source | Records per source per week; flag gaps |

## Sentiment analysis data FAQ

### What is sentiment analysis data?

Opinionated text with the context to score it: source, date, subject and any rating. Reviews, forums, video comments and news are the usual sources.

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

Yes, as weak labels: 1 and 2 stars negative, 4 and 5 positive, 3 mixed. A 4-star review can still complain at length, so hand-label a sample to measure the noise and keep a human-labeled test set. Forum and comment text needs labeling.

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

Public reviews and posts are widely used, but usernames and identifiers are personal data under GDPR or CCPA. Hash or drop authors, follow site terms, don't republish full texts, and check with your legal team.

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

Render the page with page actions that click the button and wait, as often as needed, and CSS selectors for text, rating and date. Where reviews come from an internal API, capture the XHR calls and read that JSON.

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

Plain text or Markdown, no HTML; normalize whitespace and emoji, tag language, drop near-duplicates, keep metadata in fields, split train and test by date or product.

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

By labels, not pages: for fine-tuning, a small hand-checked set per class often beats a large weak one. Collect broadly, sample every rating, source and month, and hold out a later test window.

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

Yes. Geotargeting requests from each market (Germany, Spain, Japan) so sites return local reviews in the local language. Store market and detected language per record, for 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
