--- name: apify description: Scrape TikTok, Instagram, YouTube, X, Google and thousands of other sites with Apify's ready-made scrapers (Actors). Use when the user wants trending posts, a competitor's content, comments, search results or any public web data in bulk. Needs APIFY_API_KEY. --- # Apify Key: `APIFY_API_KEY`. Get one at https://console.apify.com/settings/integrations ## Run a scraper and get the results in one call ```bash curl -s -X POST "https://api.apify.com/v2/acts/clockworks~tiktok-scraper/run-sync-get-dataset-items?timeout=120" \ -H "Authorization: Bearer $APIFY_API_KEY" -H "Content-Type: application/json" \ -d '{"hashtags":["streetfood"],"resultsPerPage":20}' ``` The reply is a JSON array, one item per result. In the URL, an Actor id's `/` becomes `~`. ## Good Actors to start with - `clockworks/tiktok-scraper`: TikTok posts by hashtag, profile or search (`hashtags`, `profiles`, `searchQueries`). - `apify/instagram-scraper`: Instagram posts, profiles and hashtags. - `apify/google-search-scraper`: Google results (`{"queries":"best espresso grinder","maxPagesPerQuery":1}`). - `streamers/youtube-scraper`: YouTube videos and channels. Each Actor's page on https://apify.com/store lists its input fields. Read it before the first run. ## Long runs The one-call form stops at 300 seconds. For bigger jobs, start a run and poll it: ```bash curl -s -X POST "https://api.apify.com/v2/acts/clockworks~tiktok-scraper/runs" -H "Authorization: Bearer $APIFY_API_KEY" -H "Content-Type: application/json" -d '{...}' curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID?waitForFinish=60" -H "Authorization: Bearer $APIFY_API_KEY" curl -s "https://api.apify.com/v2/datasets/$DATASET_ID/items?clean=true&format=json" -H "Authorization: Bearer $APIFY_API_KEY" ``` Most Actors charge per result. Ask for a small number first.