Skip to content

Repository files navigation

TikTok Scraper API for Java

Latest release Java requirements Last commit MIT license

Run in Postman

A small, configurable client with named methods and ready-to-run examples. Supports 54 TikTok Scraper API methods.

Package: com.jsonscraper:tiktok-api · Methods · Examples · Documentation

Quick start: API key, setup, first request, JSON response MCP is live: connect Instagram and TikTok data to ChatGPT, Claude or Codex with your existing API key. Connect via MCP.

Quick start

1. Get your key from the TikTok API product page and set it on your server:

export JSONSCRAPER_TIKTOK_LICENSE_KEY='your-license-key'

2. Install the package:

git clone https://github.com/jsonscraper/tiktok-api-java.git
cd tiktok-api-java
mvn install

3. Make a request:

import com.jsonscraper.tiktok.TikTok;
import java.util.Map;
import java.nio.charset.StandardCharsets;

public class Example {
 public static void main(String[] args) throws Exception {
  var client = new TikTok(System.getenv("JSONSCRAPER_TIKTOK_LICENSE_KEY"));
  var response = client.get_user_info(Map.of("query", "therock", "cache_timeout", 60));
  System.out.println(new String(response.body(), StandardCharsets.UTF_8));
 }
}

The API payload is in tiktok. Live calls require a valid API license and may consume quota. Response examples and status handling.

Main methods

54 methods are available. Common starting points:

What you need Method
Read a profile get_user_info()
Read a video get_video_by_id()
Get a video download URL get_no_watermark_url()
Read comments get_comments_by_id()
Search videos search_video()
List profile videos get_user_feed()

All methods and parameters →

Ready-to-run examples

Each example includes command-line parameters, key setup, timeouts, error handling and response output. Run it with --help first; this makes no API request.

Browse all 54 complete examples · Full method and parameter reference

Configuration

Requests use a 30-second timeout by default. Configure caching and retries to fit your application's request budget. Keys are read from your server environment; redirects are disabled.

Configuration options, HTTP errors, caching and pagination · Full integration guide

Use with ChatGPT and Codex

Prefer an assistant connection? Use the shared jsonscraper MCP server. Connect an Instagram API license, a TikTok API license, or both; each product keeps its own plan and quota. MCP source and setup.

Access, pricing and support

The SDK source is MIT-licensed. Hosted API access requires a separate TikTok license. Check current plans and get access.

Service support · SDK issues · Changelog · MIT license

Development

python3 tests/contract.py

Tests use a local/mock server and require no API key. A GitHub Actions template is available for optional automation.

The SDK has no installation or usage telemetry. README links use campaign parameters for website referral analytics. jsonscraper is independent and is not affiliated with TikTok.

Releases

Packages

Contributors

Languages