Skip to main content

cliqtomedia-apify: run Apify scrapers from Python or the command line

Cliqto Media logo

Run any public Apify Actor and get its dataset items as JSON, JSONL or CSV: Reddit, YouTube, Trustpilot, Amazon, Google Search, Indeed, Zillow, Booking.com and more. One command, no dependencies.

PyPI version Python versions License: MIT

What you get

  • A cliqtomedia-apify run command that starts an Actor, waits for it to finish and prints the results.
  • A run_actor() function that returns the dataset items as a Python list.
  • Output as json, jsonl or csv.
  • Clear errors and exit codes for a missing token, a wrong Actor name and a failed run.
  • Standard library only. It needs Python 3.9 or newer and installs no other packages.

The package works with any public Actor on Apify, not only ours. It reads dataset items with clean=true, so hidden helper fields and empty items are dropped. The Popular Actors section below lists Actors you can run right away.

Install

pip install cliqtomedia-apify

Get your Apify token

The package uses your own Apify account. It never ships a token.

  1. Create a free account at apify.com.
  2. In Apify Console, open Settings, then API & Integrations. Copy the Personal API token (how to find it).
  3. Set it as the APIFY_TOKEN environment variable:
export APIFY_TOKEN=your_token_here

On Windows PowerShell: $env:APIFY_TOKEN = "your_token_here".

You can also pass the token with --token on the command line or token= in Python. Prefer the environment variable: a --token value can end up in your shell history. Keep the token out of code you share.

Quick start: command line

cliqtomedia-apify run cliqtomedia/youtube-transcript-scraper \
  --input '{"videoUrls": ["jNQXAC9IVRw"]}' --format json

Read the input from a file:

cliqtomedia-apify run cliqtomedia/youtube-transcript-scraper --input-file input.json --format jsonl > items.jsonl
Option Meaning
--input Actor input as a JSON string
--input-file Path to a JSON file with the Actor input
--limit N Fetch at most N items
--format json (default), jsonl or csv
--timeout SECONDS How long to wait for the run (default 300)
--token Apify token (default: APIFY_TOKEN)
--version Print the package version

Exit codes: 0 success, 1 Apify or run error, 2 usage error such as a missing token, a bad option or bad input JSON, 130 interrupted with Ctrl+C (the run may still be active in Apify Console).

python -m cliqtomedia_apify run ... works the same way.

Quick start: Python

from cliqtomedia_apify import run_actor

items = run_actor(
    "cliqtomedia/youtube-transcript-scraper",
    {"videoUrls": ["jNQXAC9IVRw"]},
    limit=10,
)
print(items[0]["status"], items[0]["text"][:80])

run_actor(actor, run_input=None, *, token=None, limit=None, timeout=300, poll_interval=2.0) returns a list of dicts. It raises ApifyError (or the subclasses ApifyHTTPError and MissingTokenError) on failure.

Examples

YouTube transcript to JSON

Input for the YouTube Transcript Scraper:

{
  "videoUrls": ["jNQXAC9IVRw"]
}

Output, shortened to the main fields of the first dataset item:

[
  {
    "status": "SUCCEEDED",
    "complete": true,
    "videoId": "jNQXAC9IVRw",
    "canonicalUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "track": {
      "sourceLanguageCode": "en",
      "sourceIsGenerated": false,
      "isTranslated": false
    },
    "segments": [
      {
        "sequence": 0,
        "text": "All right, so here we are, in front of the elephants",
        "startSeconds": 1.2,
        "durationSeconds": 2.16
      }
    ],
    "segmentCount": 6
  }
]

Trustpilot reviews to CSV

The latest 5 reviews of a company with the Trustpilot Reviews Scraper:

cliqtomedia-apify run cliqtomedia/trustpilot-reviews-scraper \
  --input '{"companyDomains": ["apify.com"], "maxReviews": 5}' \
  --format csv > reviews.csv

The CSV has one row per review. Main columns: company, companyTrustScore, rating, title, text, language, date, country, verified, replyText, url.

Reddit posts to JSONL

The 5 newest posts of r/Python with the Reddit Scraper:

cliqtomedia-apify run cliqtomedia/reddit-scraper \
  --input '{"mode": "subreddit", "subreddits": ["python"], "maxPosts": 5}' \
  --format jsonl > posts.jsonl

Each line is one post with title, text, author, score, numComments, url and createdAt.

Each Actor has its own input and output fields. Read them on the Actor page.

Copy the Actor name into cliqtomedia-apify run <name> or run_actor("<name>", ...). The input fields and an example input are on each Actor page.

Social media and video

Actor name What you get Details
cliqtomedia/reddit-scraper Reddit posts, comments and subreddits Page
cliqtomedia/youtube-transcript-scraper YouTube transcripts and subtitles with timestamps Page
cliqtomedia/youtube-comments-scraper YouTube comments and replies Page
cliqtomedia/youtube-channel-videos YouTube channel videos with views, likes and Shorts Page
cliqtomedia/tiktok-transcript TikTok captions and speech to text Page
cliqtomedia/threads-scraper Threads posts, profiles and replies Page
cliqtomedia/telegram-channel-scraper Telegram channel posts and views Page
cliqtomedia/facebook-ad-library Facebook Ad Library: competitor ads Page

Search and web pages

Actor name What you get Details
cliqtomedia/google-search-scraper Google search results (SERP) Page
cliqtomedia/google-news-scraper Google News articles with real URLs Page
cliqtomedia/google-trends-scraper Google Trends interest by time, region and query Page
cliqtomedia/rag-web-search Google results as clean Markdown for RAG and LLMs Page
cliqtomedia/website-to-markdown Website pages as Markdown for RAG Page
cliqtomedia/website-contacts-scraper Emails, phones and social links from websites Page

E-commerce and prices

Actor name What you get Details
cliqtomedia/amazon-scraper Amazon products, prices, reviews and BSR Page
cliqtomedia/walmart-scraper Walmart products and reviews Page
cliqtomedia/ebay-sold-listings eBay sold listings with prices and dates Page
cliqtomedia/shopify-products-scraper Products from any Shopify store Page
cliqtomedia/aliexpress-scraper AliExpress products, prices and reviews Page
cliqtomedia/temu-scraper Temu products, prices, variants and reviews Page

Reviews and travel

Actor name What you get Details
cliqtomedia/trustpilot-reviews-scraper Trustpilot reviews, ratings and company replies Page
cliqtomedia/google-play-reviews-scraper Google Play app reviews Page
cliqtomedia/apple-app-store-reviews-scraper Apple App Store app reviews Page
cliqtomedia/booking-scraper Booking.com hotels, prices and reviews Page
cliqtomedia/tripadvisor-scraper Tripadvisor places, reviews and hotel prices Page
cliqtomedia/yelp-scraper Yelp businesses and reviews Page
cliqtomedia/airbnb-scraper Airbnb listings, prices and calendar Page

Jobs, companies and real estate

Actor name What you get Details
cliqtomedia/indeed-scraper Indeed jobs with salaries Page
cliqtomedia/glassdoor-scraper Glassdoor jobs and company reviews Page
cliqtomedia/upwork-jobs-scraper Upwork jobs with pay and client details Page
cliqtomedia/wellfound-jobs-scraper Wellfound startup jobs Page
cliqtomedia/crunchbase-companies Crunchbase companies and funding Page
cliqtomedia/zillow-scraper Zillow listings with Zestimates Page
cliqtomedia/idealista-scraper Idealista listings in Spain, Italy, Portugal and France Page
cliqtomedia/email-verifier Bulk email verification: MX, disposable and role checks Page

All 180+ Cliqto Media Actors are in the Actor catalog and on our Apify Store profile.

Control the cost

  • Set the Actor's own limit in the input, for example maxReviews or maxPosts. The cost depends on the Actor's pricing (per result, per event or compute time), so a smaller input means a smaller bill.
  • --limit only trims how many items the package downloads after the run. It does not make the run smaller.
  • Start with a small test run and check the cost in Apify Console, Runs.

Pricing

This package is free (MIT license). Running an Actor uses your own Apify account, and Apify bills that usage by the Actor's own pricing. The price of each Actor is on its Apify page. The Apify free plan includes a monthly credit. Check the price before you start.

Limits

  • It runs one Actor per call and returns when the run ends. It does not stream partial results.
  • It waits up to --timeout seconds (default 300). If the run is not done by then, the package aborts it and reports an error. Raise --timeout for big runs.
  • It reads at most the first --limit dataset items. Without --limit, it reads the whole dataset.
  • It does not manage tasks, schedules, webhooks or key-value stores. Use the full Apify API for those.
  • The run must succeed. If the Actor fails, you get an error, not partial items.

FAQ

Does it work with Actors from other authors? Yes. Use any Actor name in the form username/actor-name.

Where does the token go? Into the APIFY_TOKEN environment variable, or --token / token=. The package sends it only to api.apify.com.

Why do I get HTTP 401? Apify rejected the token. Copy it again from Console, Settings, API & Integrations.

Why do I get HTTP 404? The Actor name is wrong or the Actor is private. Check the spelling, for example cliqtomedia/youtube-transcript-scraper.

How do I save the result to a file? Redirect the output: > items.csv. Errors go to stderr, so the file holds only data.

Can I open the CSV in Excel or Google Sheets? Yes. Scraped text is written as is, so a cell that starts with =, +, - or @ may be read as a formula. Import the file as text if you do not trust the source.

Can I use it in a script or a cron job? Yes. It prints data to stdout, errors to stderr, and sets the exit code.

Metadata

Release files for cliqtomedia-apify 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cliqtomedia-apify 0.2.1
File Size Uploaded Provenance Actions
cliqtomedia_apify-0.2.1.tar.gz 11.8 kB Without provenance Details for cliqtomedia_apify-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cliqtomedia-apify 0.2.1
File Interpreter ABI Platform Actions
cliqtomedia_apify-0.2.1-py3-none-any.whl Python 3 none any Details for cliqtomedia_apify-0.2.1-py3-none-any.whl

Total release size: 23.3 kB

Release files / cliqtomedia_apify-0.2.1.tar.gz

Download URL cliqtomedia_apify-0.2.1.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
277d4343ff364044c9b6a8e1ace4178f128984697aa80ba4c23ea812bf32b5d5
BLAKE2b-256 checksum
How to use checksums
c6da3b41e1aab10e28e10a8229cf15c6d5ef23beab7d54844965e7134642bd14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release files / cliqtomedia_apify-0.2.1-py3-none-any.whl

Download URL cliqtomedia_apify-0.2.1-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba6dc0f33de29d0dac6a0f12ca473001d92fe7f8722bb55358af11904c893629
BLAKE2b-256 checksum
How to use checksums
0dac789e362ceae535003e4141b569521248d6baf9870f75b752a224eba5e33d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Security for cliqtomedia-apify 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page