jsonscraper

TikTok Scraper API: Get Video Data as JSON with jsonscraper

A practical introduction to the getVideoByID endpoint, JSON validation, and handling API keys with cURL and Python.

If your application needs information about a specific TikTok video, it’s easiest to start with a single request and check what data it returns. You can then validate the response and prepare it for storage or analysis.

The TikTok Scraper API from jsonscraper page lists endpoints for videos, users, search, hashtags, music, and other data types. Below, we’ll look at the documented getVideoByID request and ways to handle its response safely. The examples are based on the provider’s materials; verify them with an active key and the latest documentation before use.

First request: Get video information

Laptop with code and plant in coffee shop
James Harrison

The Postman documentation for getVideoByID specifies the GET method and the video_id parameter. The example also shows region and cache_timeout. The base URL published on the service page is https://tiktok.evelode.com.

Example request with cURL:

export JSONSCRAPER_LICENSE_KEY="your_key"

curl --get "https://tiktok.evelode.com/getVideoByID" \
  --data-urlencode "video_id=7106855913906081070" \
  --data-urlencode "license_key=$JSONSCRAPER_LICENSE_KEY" \
  --data-urlencode "region=US"

The ID in the example comes from the published request. Replace it with the ID of the video you want to check. Store the key in an environment variable or a secrets manager: don’t add it to a public repository, client-side JavaScript, or logs.

Postman describes region as a region code and lists US as the default value. For cache_timeout, the documentation specifies a default cache window of 3600 seconds; a value of 0 disables caching. If you need this parameter for your use case, you can pass it explicitly:

curl --get "https://tiktok.evelode.com/getVideoByID" \
  --data-urlencode "video_id=7106855913906081070" \
  --data-urlencode "license_key=$JSONSCRAPER_LICENSE_KEY" \
  --data-urlencode "region=US" \
  --data-urlencode "cache_timeout=0"

This adapts the parameters published for the endpoint; it does not guarantee that all responses will have the same structure or that disabling caching is suitable for every task. Before implementation, check the authorization method and parameters against the current collection: Postman may pass the key through a configured API Key, while the cURL example above shows it as a URL parameter.

The same request in Python

Here’s an example using Python’s standard library. It builds a GET request, passes the parameters, and handles network errors, HTTP errors, and invalid JSON.

import json
import os
from urllib.error import HTTPError, URLError
from urllib.parse import urlencode
from urllib.request import Request, urlopen

base_url = "https://tiktok.evelode.com/getVideoByID"
license_key = os.environ.get("JSONSCRAPER_LICENSE_KEY")

if not license_key:
    raise RuntimeError("Set the JSONSCRAPER_LICENSE_KEY environment variable")

params = {
    "video_id": "7106855913906081070",
    "license_key": license_key,
    "region": "US",
}

url = f"{base_url}?{urlencode(params)}"
request = Request(url, method="GET")

try:
    with urlopen(request, timeout=30) as response:
        status_code = response.status
        payload = json.loads(response.read().decode("utf-8"))
except HTTPError as error:
    print(f"HTTP error: {error.code}")
    raise
except URLError as error:
    print(f"Network error: {error.reason}")
    raise
except json.JSONDecodeError:
    raise RuntimeError("Could not parse the service response as JSON")

print("HTTP status:", status_code)
print("Top-level keys:", list(payload.keys()))

This adapts the documented request; it isn’t an example that the provider has separately tested for Python. It also doesn’t cover every possible service response. Since the key is passed in the URL, don’t print the full URL to logs: it may contain a secret.

How to validate the JSON response

The published Postman response contains a status field and a nested tiktok.aweme_detail object with video and author data. This is an example of the shape of one response, not a guarantee that the schema will remain unchanged. You can inspect it in the getVideoByID response example.

Check each level when accessing nested fields:

def get_video_details(payload):
    tiktok = payload.get("tiktok")
    if not isinstance(tiktok, dict):
        return None

    details = tiktok.get("aweme_detail")
    if not isinstance(details, dict):
        return None

    return details

details = get_video_details(payload)

if details is None:
    print("The expected video data object is missing from the response")
else:
    video_id = details.get("id")
    description = details.get("desc")
    author = details.get("author")

    print("ID:", video_id)
    print("Description:", description)
    print("Author:", author)

The field names come from the published example. Using .get() doesn’t mean the fields are required; it lets you handle responses where expected values are missing. If your application logic depends on a specific field, check that it exists in responses for your use case and plan what to do if it’s absent.

It’s useful to separate three checks:

  1. Transport: Was an HTTP response received, and what was its status?
  2. Format: Could the response body be parsed as JSON?
  3. Content: Is the data the application needs present?

Successfully parsing JSON doesn’t mean the response contains the object you need. For troubleshooting, record technical errors and validation results, while masking keys.

From one request to a working pipeline

Speedcurve Performance Analytics
Luke Chesser

For a prototype, it’s enough to send a request and print a few values. For regular processing, divide the work into stages:

Request → validation → normalization → deduplication → storage.

  • Request. Get a response from the documented endpoint and store the technical status separately.
  • Validation. Make sure the body parses as JSON and contains the data needed for the specific task.
  • Normalization. Map the values you need to your own data model. Don’t copy the entire nested structure into your database if the application only needs selected fields.
  • Deduplication. Choose an identifier only after verifying that it’s present and suitable for your use case. Don’t assume it will always be available in every response.
  • Storage. If needed, store the request time and original response separately from the normalized record. This helps you understand what changes the application made.

These are recommendations for structuring an application, not features to attribute to the service. Separating the external response from your internal model also makes changes easier to handle: you can look for problems in the validation or normalization stage rather than throughout the codebase.

For recurring requests, decide in advance when to refresh data and which errors are worth retrying. Limit the number of retries: an infinite loop won’t fix an invalid parameter or an authorization problem.

Caching and region

In the description of the getVideoByID endpoint, the cache_timeout parameter sets the cache duration in seconds: the listed default is 3600 seconds, and 0 disables caching. The region parameter is described as a country code, with US given as an example. Check these details against the current Postman request documentation before implementation.

The presence of a cache setting doesn’t confirm that a particular response is fresh. If freshness matters, check the results of repeated requests using data from your use case and choose an appropriate approach.

What to explore next

The product page lists endpoints for searching videos and users, hashtags, locations, music, and trends. Examples include searchVideo, searchHashtag, getUserFeed, and getTrendingFeed. This is the provider’s published endpoint overview, not an independent verification of each endpoint. Consult the documentation for each specific endpoint to learn its parameters and response format; you can’t automatically apply them from the getVideoByID example.

jsonscraper recommends using the Postman collection to configure a key and run requests. This can be a convenient way to test an individual endpoint before writing an integration. The service also lists automation use cases, but you should check the compatibility of any specific workflow separately in your own configuration. When exporting or sharing the collection, make sure it doesn’t contain an active key.

What to check before using it in an application

Before adding the request to a recurring process, test it with the videos and parameters your project needs:

  • Does the request work with an active key and a valid ID?
  • How does the application handle an invalid or missing parameter?
  • What happens if the JSON is valid but the required field is missing?
  • How are HTTP errors, network failures, and timeouts handled?
  • Which fields are suitable for identification and deduplication in your specific use case?
  • How does the result of a repeated request change with different cache_timeout values, if you use this parameter?

Record the date of the check, parameters without secrets, and an anonymized response example. One successful request confirms only that a specific scenario worked under specific conditions; it doesn’t prove that all endpoints and responses are stable.

Start with one reproducible scenario

Test getVideoByID with the video you need, inspect the actual JSON, and write a handler that accounts for missing fields and errors. Then, if needed, extend the process with normalization, deduplication, and storage.

The jsonscraper documentation provides a starting point—the base URL and endpoint overview. Production code still needs to validate the specific response, protect the key, and account for cases where data differs from the expected structure.

Related

Community Pulse · Guide

Claude Code or Codex: Compare Your Work, Not the Brand

Developer opinions on Claude Code and Codex differ, and PR research does not identify a universal winner. The practical way to compare the tools is to test them on the tasks and in the environment where you actually work.

Turn what you read into a working integration

Explore jsonscraper's social-data APIs, test requests and build your next workflow.

Explore APIs