Skip to content

Python guide

Scrape TikTok profile videos
with Python.
Plays, likes, shares. One script.

Captions, plays, likes, comments, shares and dates for a public TikTok account’s videos, saved to CSV. One API key. No TikTok login, cookies or browser.

  • 1 creditper page
  • 15videos a page, recorded
  • 0TikTok logins
import csv
import os
import requests

API_URL = "https://www.monocrawl.com/v1/tiktok/profile-videos"
HEADERS = {"x-api-key": os.environ["MONOCRAWL_API_KEY"]}


def get_videos(handle, max_pages=5, **options):
    params = {"handle": handle, **options}
    for _ in range(max_pages):
        body = requests.get(API_URL, params=params, headers=HEADERS, timeout=60).json()
        if not body.get("success"):
            raise RuntimeError(body["error"]["message"])
        data = body["data"]
        yield from data["items"]
        if not data.get("has_more") or not data.get("cursor"):
            break
        params["cursor"] = data["cursor"]


STATS = ["plays", "likes", "comments", "shares", "saves"]

with open("videos.csv", "w", newline="", encoding="utf-8") as file:
    writer = csv.writer(file)
    writer.writerow(["id", "created_at", "duration_s", *STATS, "url", "caption"])
    for video in get_videos("nasa"):
        stats = video.get("stats") or {}
        writer.writerow([video.get("id"), video.get("created_at"), video.get("duration_s"),
                         *[stats.get(stat) for stat in STATS], video.get("url"), video.get("caption")])

$ python videos.py

GET /v1/tiktok/profile-videos handle=nasa · page 1

✓ 15 videos · 1 credit · has_more: true

↻ following the cursor · pages 2 and 3: 30 more videos · no repeats

✓ page 4: 3 videos · has_more: false, loop stops

✓ videos.csv · 48 rows · 4 pages · 4 credits

Replay of a real call, recorded 26 Sep 2026

Four steps

Copy, paste, run.
See what each step returns.

Terminal
export MONOCRAWL_API_KEY="mn_your_key_here"
pip install requests

What you get

MONOCRAWL_API_KEY=mn_••••••••Free plan · 1,000 credits a month · No card

What comes back

One page.
Real videos.

A real page of NASA’s TikTok videos: 15 videos for 1 credit. 6 are below, with their plays, likes, comments and shares.

  • idThe video’s TikTok id
  • captionThe caption, as posted
  • created_atWhen, as an ISO timestamp
  • statsPlays, likes, comments, shares and saves
  • duration_sLength in seconds
  • urlThe video on tiktok.com
  • video_url, musicThe video file and the sound it uses
  1. 50 years ago today, we introduced Enterprise. 🚀 NASA’s first Space Shuttle orbiter never flew to space, but the tests it performed helped make the shuttle missions that followed possible.

    129,8009,59930543817 Sept 2026
  2. Turns out you can dance in space! 🪩🕺💫🛰️ Microgravity just unlocked some new moves.

    616,10090,4001,7894,73216 Sept 2026
  3. We’re going back to the Moon. This time, to stay. 🌙 Since announcing plans for a Moon Base in March, NASA has been moving quickly to turn that vision into reality. No aim too high. No journey too far.

    472,90040,6008303,0899 Sept 2026
  4. Roman’s first images will be so large and detailed, you’d need a 4K TV the size of 45 city blocks to display just one. 🤯 The telescope is traveling 1 million miles from Earth, with its first images expected in early 2027. 🔭

    270,20013,7002653924 Sept 2026
  5. We just launched a new telescope into space. 🚀 The Nancy Grace Roman Space Telescope is officially on its way. Time to unlock the secrets of the universe. 🔭

    911,700118,1002,3256,22730 Aug 2026
  6. A pretty historic day here at NASA 🏅💫

    696,400125,4002,1374,83129 Aug 2026
Show the JSON
{
  "success": true,
  "data": {
    "count": 15,
    "has_more": true,
    "cursor": "mlc1.…",
    "items": [
      {
        "id": "7686548688113503502",
        "url": "https://www.tiktok.com/@nasa/video/7686548688113503502",
        "caption": "50 years ago today, we introduced Enterprise. 🚀 NASA’s first Space Shuttle orbiter never flew to space, but the tests it performed helped make the shuttle missions that followed possible.",
        "created_at": "2026-09-17T16:54:50.000Z",
        "duration_s": 144,
        "stats": {
          "plays": 129800,
          "likes": 9599,
          "comments": 305,
          "shares": 438,
          "saves": 1164
        }
      },
      {
        "id": "7686148096895569165",
        "url": "https://www.tiktok.com/@nasa/video/7686148096895569165",
        "caption": "Turns out you can dance in space! 🪩🕺💫🛰️ Microgravity just unlocked some new moves.",
        "created_at": "2026-09-16T15:00:41.000Z",
        "duration_s": 58,
        "stats": {
          "plays": 616100,
          "likes": 90400,
          "comments": 1789,
          "shares": 4732,
          "saves": 7019
        }
      },
      {
        "id": "7683502372135505165",
        "url": "https://www.tiktok.com/@nasa/video/7683502372135505165",
        "caption": "We’re going back to the Moon. This time, to stay. 🌙 Since announcing plans for a Moon Base in March, NASA has been moving quickly to turn that vision into reality. No aim too high. No journey too far.",
        "created_at": "2026-09-09T11:53:38.000Z",
        "duration_s": 66,
        "stats": {
          "plays": 472900,
          "likes": 40600,
          "comments": 830,
          "shares": 3089,
          "saves": 3613
        }
      },
      {
        "id": "7681723633164717325",
        "url": "https://www.tiktok.com/@nasa/video/7681723633164717325",
        "caption": "Roman’s first images will be so large and detailed, you’d need a 4K TV the size of 45 city blocks to display just one. 🤯 The telescope is traveling 1 million miles from Earth, with its first images expected in early 2027. 🔭",
        "created_at": "2026-09-04T16:51:37.000Z",
        "duration_s": 0,
        "stats": {
          "plays": 270200,
          "likes": 13700,
          "comments": 265,
          "shares": 392,
          "saves": 984
        }
      },
      {
        "id": "7679801381103865101",
        "url": "https://www.tiktok.com/@nasa/video/7679801381103865101",
        "caption": "We just launched a new telescope into space. 🚀 The Nancy Grace Roman Space Telescope is officially on its way. Time to unlock the secrets of the universe. 🔭",
        "created_at": "2026-08-30T12:32:21.000Z",
        "duration_s": 27,
        "stats": {
          "plays": 911700,
          "likes": 118100,
          "comments": 2325,
          "shares": 6227,
          "saves": 8358
        }
      },
      {
        "id": "7679483952507276558",
        "url": "https://www.tiktok.com/@nasa/video/7679483952507276558",
        "caption": "A pretty historic day here at NASA 🏅💫",
        "created_at": "2026-08-29T16:00:17.000Z",
        "duration_s": 25,
        "stats": {
          "plays": 696400,
          "likes": 125400,
          "comments": 2137,
          "shares": 4831,
          "saves": 11600
        }
      }
    ]
  }
}

Cost

1 credit a page.
Nothing for failures.

Every page of videos costs 1 credit. The recorded run collected all 48 of NASA’s videos in 4 pages, for 4 credits. An account’s profile costs 1 credit too. Slide to see what a collection costs.

4credits, one per page
250collections like this a month on the free plan
2,500on Starter, $29 a month

Estimated at 15 videos a page, as on pages 1 to 3 of the recorded run. Failed calls are free.

Two more things

Account totals,
errors and rate limits.

Account totals first

tiktok/profile returns an account’s followers, total likes and video count for 1 credit. NASA’s profile showed 1,831,352 followers and 48 videos, and the loop above collected all 48 in 4 pages. For the comments on any of the videos, pass its url to tiktok/post-comments.

Scrape TikTok comments with Python
profile.py
PROFILE_URL = "https://www.monocrawl.com/v1/tiktok/profile"

body = requests.get(PROFILE_URL, params={"handle": "nasa"}, headers=HEADERS, timeout=60).json()
profile = body["data"]
print(profile["followers"], profile["likes_count"], profile["video_count"])

Errors and rate limits

A failed call returns success: false with an error type and message, and costs nothing. On HTTP 429, wait and try again.

Rate limits by plan
videos.py
import time

def get_page(params, attempts=5):
    for attempt in range(attempts):
        response = requests.get(API_URL, params=params, headers=HEADERS, timeout=60)
        if response.status_code != 429:
            return response.json()
        time.sleep(2 ** attempt)
    raise RuntimeError("Still rate limited; try again later")

Other platforms

Same loop.
Swap the endpoint.

The same key collects an account’s videos on other platforms. Each endpoint’s reference lists its fields and paging.

Questions

Scraping TikTok videos,
answered.

Do I need a TikTok account, cookies or a browser?

No. You call Monocrawl with your API key and get the videos back as JSON. It works for public accounts.

How many videos does one call return?

One page. On the recorded run, pages 1 to 3 returned 15 videos each, newest first, and page 4 the last 3, with has_more set to false.

What does it cost?

1 credit for each page that comes back, and 1 credit for an account’s profile. The free plan’s 1,000 credits a month cover 1,000 pages, about 15,000 videos at the recorded rate, and failed calls are free.

Can I get an account’s most popular videos?

Yes. Call get_videos("nasa", sort_by="popular") and the same loop pages through the account’s most popular videos instead, 1 credit a page. The script keeps sort_by on every page.

Can I get the comments on each video?

Yes. Pass a video’s url to tiktok/post-comments: about 50 comments a page, 1 credit a page. Our TikTok comments guide shows the loop.

Does TikTok have an official API for this?

TikTok’s own APIs have their own access rules. Our TikTok data API comparison sets out the official routes and the main providers side by side.

Start free

Videos from any public TikTok account.
1 credit a page.

1,000 free credits every month. No card required.

Get a free API key