Scrape YouTube search results
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.youtube.search({ query: "rust tutorial" });
console.log(result.data.results);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.youtube.search(query="rust tutorial")
print(result["data"]["results"])
curl -X POST https://api.stophy.dev/v1/youtube/search \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"query":"rust tutorial"}'
stophy youtube search "rust tutorial"
{
"success": true,
"data": {
"results": [
{
"type": "video",
"videoId": "Wc0ZJo06oAw",
"videoUrl": "https://www.youtube.com/watch?v=Wc0ZJo06oAw",
"title": "The Ultimate Rust Beginners Guide (2026)",
"channelId": "UCt6XPuD8u3YjvybuT-Xnj5A",
"channelName": "SBJake",
"channelUrl": "https://www.youtube.com/channel/UCt6XPuD8u3YjvybuT-Xnj5A",
"channelUsername": "SBJake",
"durationSeconds": 422,
"views": 545124,
"thumbnailUrl": "https://i.ytimg.com/vi/Wc0ZJo06oAw/hqdefault.jpg",
"isShort": false,
"isLive": false,
"publishedAt": "2025-09-30T13:12:21.000Z"
},
{
"type": "video",
"videoId": "BpPEoZW5IiY",
"videoUrl": "https://www.youtube.com/watch?v=BpPEoZW5IiY",
"title": "Learn Rust Programming - Complete Course 🦀",
"channelId": "UC8butISFwT-Wl7EV0hUK0BQ",
"channelName": "freeCodeCamp.org",
"channelUrl": "https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ",
"channelUsername": "freecodecamp",
"durationSeconds": 50350,
"views": 1248090,
"thumbnailUrl": "https://i.ytimg.com/vi/BpPEoZW5IiY/hqdefault.jpg",
"isShort": false,
"isLive": false,
"publishedAt": "2023-10-01T01:33:57.000Z"
}
],
"cursor": "EqIDEg1ydXN0IHR1dG9yaWFs…"
},
"creditsUsed": 1,
"requestId": "2fe9dbad-fc48-4890-9751-0b24b596035b"
}
Endpoints
| Endpoint | Cost |
|---|---|
| Scrape YouTube search results | 1 credit (no key needed) |
| Scrape YouTube search suggestions | 1 credit |
| Scrape a YouTube video page | 1 credit (no key needed) |
| Scrape a YouTube video’s transcript | 1 credit (no key needed) |
| Scrape the comments of a YouTube video | 1 credit (no key needed) |
| Scrape a YouTube channel and its videos | 1 credit (no key needed) |
| Scrape a YouTube playlist and its videos | 1 credit |
| Scrape a YouTube community post and its comments | 1 credit |
| Scrape a TikTok profile and its videos | 1 credit (no key needed) |
| Scrape a TikTok video | 1 credit |
| Scrape a TikTok video’s transcript | From 1 credit (no key needed) |
| Scrape TikTok videos for a hashtag | 1 credit |
| Scrape a TikTok sound and its videos | 1 credit |
| Scrape the comments of a TikTok video | 1 credit |
| Scrape TikTok search results | 1 credit |
| Scrape an Instagram video’s transcript | From 1 credit |
More ways to call it
Scrape a YouTube video’s transcript
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.youtube.transcript({ videoUrl: "https://www.youtube.com/watch?v=dQw4w9WgXcQ" });
console.log(result.data.text);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.youtube.transcript(video_url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
print(result["data"]["text"])
curl -X POST https://api.stophy.dev/v1/youtube/transcript \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"videoUrl":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'
stophy youtube transcript --videoUrl "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
Scrape a TikTok profile and its videos
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.tiktok.profile({ username: "khaby.lame" });
console.log(result.data.results);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.tiktok.profile(username="khaby.lame")
print(result["data"]["results"])
curl -X POST https://api.stophy.dev/v1/tiktok/profile \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"username":"khaby.lame"}'
stophy tiktok profile --username khaby.lame
YouTube search, video, transcript, comments and channel work without a key, and so do TikTok profiles and TikTok transcripts. A YouTube transcript costs 1 credit. TikTok and Instagram transcripts are priced by the video, so see Credits and billing. TikTok videos over 3 minutes can’t be transcribed.