Youtube Shorts Engagement Scraper avatar

Youtube Shorts Engagement Scraper

Pricing

from $2.00 / 1,000 results

Go to Apify Store
Youtube Shorts Engagement Scraper

Youtube Shorts Engagement Scraper

Extract public engagement metrics from YouTube Shorts and regular YouTube video URLs — views, likes, comments, engagement count, and engagement rate — without requiring a YouTube API key or browser automation.

Pricing

from $2.00 / 1,000 results

Rating

0.0

(0)

Developer

Andy Nguyen

Andy Nguyen

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

2

Monthly active users

11 hours ago

Last modified

Categories

Share

Extract public engagement metrics from YouTube Shorts and regular YouTube video URLs — views, likes, comments, and engagement count. The Actor scrapes public YouTube pages first and uses the official YouTube Data API v3 internally as a fallback when scraping is blocked or incomplete. No API key is required from users.

This Apify Actor accepts one or more YouTube URLs, fetches the public page, parses embedded JSON data, and returns normalized results to the default dataset. You can schedule runs, call the Actor via API, export data as JSON/CSV/Excel, and integrate with other Apify tools.

Disclaimer: This is an unofficial Actor and is not affiliated with, sponsored by, or endorsed by YouTube or Google.

What does this Actor do?

Given YouTube Shorts or YouTube video URLs, the Actor returns:

  • Views (viewCount)
  • Likes (likeCount)
  • Comments (commentCount)
  • Engagement count (engagementCount = likes + comments)

It also returns useful metadata such as title, channel info, publish date, duration, and thumbnail URL.

Why use this Actor?

  • No user API key required — scraping works out of the box
  • Internal YouTube Data API fallback — improves results when page scraping is blocked or partial
  • Batch processing — up to 1,000 URLs per run
  • Normalized output — consistent schema for analytics and reporting
  • Apify platform benefits — scheduling, proxy support, dataset exports, API access, monitoring

Supported URL formats

The Actor accepts these YouTube URL formats (query parameters such as ?si=..., ?feature=shared, and ?utm_source=... are ignored):

https://www.youtube.com/shorts/VIDEO_ID
https://youtube.com/shorts/VIDEO_ID
https://www.youtube.com/watch?v=VIDEO_ID
https://youtu.be/VIDEO_ID

Every successful result uses the canonical output URL:

https://www.youtube.com/shorts/VIDEO_ID

Invalid URLs are logged and skipped without stopping the run. Duplicate video IDs are deduplicated automatically.

How to use this Actor

  1. Open the Actor in Apify Console or run it locally.
  2. Add one or more YouTube Shorts or YouTube video URLs to Start URLs.
  3. Optionally adjust Max Concurrency (default: 10) and Proxy Configuration.
  4. Start the run.
  5. Download results from the Output tab or via the Dataset API.

Input example

{
"startUrls": [
{ "url": "https://www.youtube.com/shorts/aqz-KE-bpKQ" },
{ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }
],
"maxConcurrency": 10,
"proxyConfiguration": {
"useApifyProxy": false
}
}

Internal YouTube Data API fallback

The Actor scrapes the public YouTube page first. When scraping fails or returns incomplete engagement metrics, it automatically falls back to the official YouTube Data API v3 using an internal API key configured by the Actor owner.

Fallback is used when:

  • the page fetch fails
  • a consent or bot-check page is returned
  • embedded JSON is missing or incomplete
  • one or more primary engagement fields (viewCount, likeCount, commentCount) are unavailable from HTML scraping

The fallback only fills missing fields. It does not overwrite values already extracted from the page.

Actor owners configure the internal key before deployment:

apify secrets add youtubeApiKey YOUR_YOUTUBE_DATA_API_KEY
apify push

For local development, set YOUTUBE_API_KEY in the environment or add the same Apify secret locally with apify secrets add.

Each fallback lookup uses one videos.list quota unit. Hidden likes may still return null even through the official API.

Output example

{
"videoId": "aqz-KE-bpKQ",
"url": "https://www.youtube.com/shorts/aqz-KE-bpKQ",
"originalUrl": "https://www.youtube.com/shorts/aqz-KE-bpKQ",
"title": "Sample YouTube Short #viral #AI",
"description": "Video description... Check out #shorts and #tech",
"hashtags": ["viral", "ai", "shorts", "tech"],
"channel": {
"id": "UCxxxxxxxxxxxxxxxx",
"name": "Channel Name",
"url": "https://www.youtube.com/channel/UCxxxxxxxxxxxxxxxx"
},
"publishedAt": "2024-01-15T10:30:00.000Z",
"durationSeconds": 45,
"isShort": true,
"viewCount": 1234567,
"likeCount": 42000,
"commentCount": 1500,
"engagementCount": 43500,
"thumbnailUrl": "https://i.ytimg.com/vi/.../maxresdefault.jpg",
"status": "success",
"missingFields": [],
"collectedAt": "2026-08-28T00:00:00.000Z"
}

You can download the dataset in various formats such as JSON, CSV, Excel, XML, RSS, or fetch items through the Dataset API.

Engagement formula

engagementCount = likeCount + commentCount (only when both are available)

Missing metrics are returned as null, not zero. A hidden like count is not treated as zero likes.

Data table

FieldDescription
titleVideo title
descriptionVideo description
hashtagsExtracted hashtags (lowercase, deduplicated)
channel.nameChannel display name
channel.idYouTube channel ID
channel.urlChannel profile URL
viewCountPublic view count
likeCountPublic like count (null if hidden)
commentCountPublic comment count (null if unavailable/disabled)
engagementCountLikes + comments
publishedAtPublish date (ISO 8601 UTC)
statussuccess or partial
urlCanonical YouTube Shorts URL
collectedAtCollection timestamp (ISO 8601 UTC)

Available metrics

  • Views
  • Likes (when publicly shown)
  • Comments (when publicly shown)
  • Derived engagement count

Unavailable metrics

  • Share count
  • Save count
  • Individual comment text
  • Private analytics not shown on the public page

How to run locally

npm install
apify run

To clear previous local storage between runs:

$apify run --purge

Local runs store output in the storage/ directory. Local storage is not synced to Apify Cloud automatically.

How to deploy

apify login
apify push

How to call through the Apify API

Replace YOUR_API_TOKEN and YOUR_ACTOR_ID with your values:

curl -X POST "https://api.apify.com/v2/acts/YOUR_ACTOR_ID/runs?token=YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"startUrls": [{ "url": "https://www.youtube.com/shorts/aqz-KE-bpKQ" }],
"maxConcurrency": 10
}'

Fetch dataset items from the run’s default dataset URL returned by the API.

Pricing / cost estimation

Cost depends on Apify compute units, run duration, concurrency, and proxy usage. Processing more URLs or using proxies increases cost. Start with a small URL batch to estimate usage for your workload.

Tips and advanced options

  • Use lower concurrency (1–5) if you see HTTP 429 rate limiting.
  • Enable Apify Proxy if you encounter HTTP 403 responses or regional blocks.
  • Prefer YouTube Shorts URLs when you know the content is a Short (isShort will be true).
  • Check status and missingFields for partial results instead of assuming all metrics exist.

Limitations

  • Uses CheerioCrawler (HTTP + HTML parsing), not a full browser. YouTube is JavaScript-heavy; metrics are extracted from embedded JSON (ytInitialPlayerResponse, ytInitialData) when present.
  • Hidden likes, disabled comments, private, deleted, age-restricted, and consent pages may prevent full metrics.
  • YouTube may change page structure without notice; the parser is defensive but not guaranteed against all future changes.
  • One failed URL does not stop the rest of the run.

If live HTML no longer includes sufficient embedded JSON for your use case, the smallest next step is switching to PlaywrightCrawler for JavaScript-rendered content — that migration is not included in this Actor.

Responsible use

  • Respect YouTube Terms of Service and applicable laws.
  • Scrape only public data you are permitted to collect.
  • Avoid excessive request rates; use reasonable concurrency.
  • Do not use this Actor to collect personal data without a lawful basis.

Troubleshooting

IssueWhat to try
HTTP 403 / 429Enable Apify Proxy, reduce maxConcurrency, retry later
Consent page / missing JSONEnable Apify Proxy and retry; internal API fallback may recover metrics
status: "partial"Check missingFields; internal API fallback may fill missing public metrics
Invalid URL skippedConfirm URL format and 11-character video ID
No results locallyCheck storage/datasets/default/*.json after apify run

FAQ and support

  • Is this official? No. This Actor is unofficial and not affiliated with YouTube or Google.
  • Do I need an API key? No. Users do not provide a YouTube API key. The Actor owner configures the internal fallback key.
  • Does it download videos? No. It only reads public page HTML/metadata.
  • Report issues or request features via the Apify Console Issues tab.

Project structure

.actor/ # Actor configuration and schemas
src/
main.ts # Orchestration entry point
config.ts # Internal environment configuration
types.ts # Input/output types
youtube-url.ts # URL validation and normalization
youtube-parser.ts # Embedded JSON extraction
youtube-api.ts # YouTube Data API fallback
metrics.ts # Engagement calculations
handler.ts # Cheerio request handlers
test/ # Vitest unit tests with fixtures

Development

npm install
npm run build
npm test
npm run lint
npm run format:check
apify validate-schema