# How to Save TikTok Search Results to JSONL Without Losing Videos

https://jsonscraper.com/blog/save-tiktok-search-results-jsonl

Author: Michael Johnson

Published: 2026-11-25T11:36:53+00:00

Updated: 2026-11-25T11:36:53+00:00

Normalize both /searchVideo response branches and build a local catalog from fields actually returned

A handler that reads only `tiktok.aweme_list` may save an empty file even though the videos are present in another branch of the JSON. In a check of `/searchVideo` on November 25, 2026, using `keyword=reusable water bottle` and `count=2`, the outer status was `ok`, `aweme_list` was empty, and the video was in `search_item_list[].aweme_info`. This is an observation from one result; below is an example exporter that handles both structures and writes each accepted record on a separate JSONL line.

 

## What can be lost

 

JSONL is convenient for a local catalog: each line is a separate JSON object, so you can append to the file, read it as a stream, and pass it to later processing stages. For manual review, it is enough to store the identifier, link, description, and any counters actually present in the response.



![Article: How to Save TikTok Search Results to JSONL Without Losing Videos
Summary: In one check of the TikTok API, the videos appeared in search_item_list\[\].aweme_info while aweme_list was empty. This Python example handles both structures and writes each video as a separate JSONL line.
Image role: cover — the central idea
Section: What can be lost
Visual subject: Editorial illustration: a magnified branching JSON data structure represented as translucent cards, one branch ](https://jsonscraper.com/assets/uploads/journal/2026/11/7101f517d7eda3783851c02e5c6ceed0.png.hero.webp)

Two branches of a search response© jsonscraper · AI-generated

 

There are two search-result branches to account for during normalization: `tiktok.aweme_list` and `tiktok.search_item_list[].aweme_info`. If your code checks only the first, a particular response with an empty array can give the false impression that there are no results. The documented schema also lists video, author, and statistics fields, though individual values may be absent.

 

## Prepare the request

 

Search uses the GET route `https://tiktok.evelode.com/searchVideo` with the required `keyword` parameter. The documentation lists the additional parameters `cursor`, `count`, `cache_timeout`, `date_posted`, `sort_by`, and `region`. For the first request, a keyword and a small `count` are enough; you will need a cursor if you decide to continue through the results.

 

Authentication passes `license_key` in the query. Store the value in the `JSONSCRAPER_TIKTOK_LICENSE_KEY` environment variable, not in a source file or command log. The example below uses Python 3.8+ and the `requests` package:

 

```
import json
import os
from pathlib import Path

import requests

BASE_URL = "https://tiktok.evelode.com/searchVideo"
KEYWORD = "reusable water bottle"
OUTPUT = Path("tiktok-results.jsonl")

license_key = os.environ["JSONSCRAPER_TIKTOK_LICENSE_KEY"]
response = requests.get(
    BASE_URL,
    params={
        "license_key": license_key,
        "keyword": KEYWORD,
        "count": 10,
    },
    timeout=30,
)
response.raise_for_status()
payload = response.json()

if payload.get("status") != "ok":
    raise RuntimeError(f"API status: {payload.get('status')!r}")
```

 

The call to `raise_for_status()` handles HTTP errors, while checking `status` handles the API's outer response status. Passing the key through `params` is convenient for this example; when diagnosing problems, do not print the full request URL, as it will contain the secret parameter.

 

## Collect both response branches

 

After checking the outer status, get the `tiktok` object. Add items from `aweme_list`, then extract `aweme_info` from the `search_item_list` entries. Type checks protect the handler from a missing array or unexpected entry; deduplicating by `aweme_id` removes duplicates if a video appears in both branches.



![Article: How to Save TikTok Search Results to JSONL Without Losing Videos
Summary: In one check of the TikTok API, the videos appeared in search_item_list\[\].aweme_info while aweme_list was empty. This Python example handles both structures and writes each video as a separate JSONL line.
Image role: supporting illustration 2 — a different specific aspect
Section: Collect both response branches
Visual subject: Editorial infographic showing a simple verified data pipeline: GET keyword request](https://jsonscraper.com/assets/uploads/journal/2026/11/14be03139644abfdbc6d2221d5fc418e.png.hero.webp)

From request to JSONL catalog© jsonscraper · AI-generated illustration

 

```
tiktok = payload.get("tiktok") or {}
items = []

aweme_list = tiktok.get("aweme_list") or []
if isinstance(aweme_list, list):
    items.extend(item for item in aweme_list if isinstance(item, dict))

search_items = tiktok.get("search_item_list") or []
if isinstance(search_items, list):
    for entry in search_items:
        if not isinstance(entry, dict):
            continue
        aweme_info = entry.get("aweme_info")
        if isinstance(aweme_info, dict):
            items.append(aweme_info)

seen_ids = set()
records = []
for item in items:
    video_id = item.get("aweme_id")
    if video_id and video_id in seen_ids:
        continue
    if video_id:
        seen_ids.add(video_id)

    author = item.get("author") or {}
    stats = item.get("statistics") or {}
    if not isinstance(author, dict):
        author = {}
    if not isinstance(stats, dict):
        stats = {}

    record = {}
    if video_id is not None:
        record["aweme_id"] = video_id
    for key in ("desc", "create_time", "share_url"):
        if key in item:
            record[key] = item[key]

    author_fields = {
        key: author[key]
        for key in ("unique_id", "nickname", "uid")
        if key in author
    }
    if author_fields:
        record["author"] = author_fields

    statistics_fields = {
        key: stats[key]
        for key in ("play_count", "digg_count", "comment_count", "share_count")
        if key in stats
    }
    if statistics_fields:
        record["statistics"] = statistics_fields

    records.append(record)

with OUTPUT.open("w", encoding="utf-8") as file:
    for record in records:
        file.write(json.dumps(record, ensure_ascii=False) + "\n")

print(f"Records saved: {len(records)}; file: {OUTPUT}")
```

 

The code adds the description, publication time, and link keys only when they are present in the API object. Similarly, nested author and statistics blocks are included in a record only when returned fields are available. A value present in the response as `null` is preserved as received; a missing key does not appear in the JSONL.

 

Records without `aweme_id` remain in the catalog, but cannot be deduplicated by identifier. If your downstream processing requires an identifier, add an explicit rule to skip such records; this example preserves the found object without assigning it a missing field.

 

This is a demonstration example and has not been run. The separate dated API check confirms only the described shape of one result, not the outcome of exporting with this script.

 

## Validate the JSONL before further processing

 

A successful run creates a file where each line is a separate object. For example, a record might have this structure:

 

```
{"aweme_id":"…","desc":"…","share_url":"…","author":{"unique_id":"…"},"statistics":{"play_count":123}}
```

 

This is a schematic example, not an actual record from the check. Before using the catalog, verify that the lines parse as JSON, that identifiers are preserved where the API returned them, and that missing counters have not been turned into zeros. You can then pass the file to your own script, load it into an analytics database, or open it to manually review links and descriptions.

 

For the next results page, pass the returned `cursor` value into the next request as an opaque value; save the records actually received, and do not treat pagination as a guarantee of complete coverage of all matching TikTok videos. Check parameters and schema against the [TikTok API documentation](https://github.com/jsonscraper/tiktok-api-python/blob/main/docs/endpoints.md) and the [request specification](https://jsonscraper.com/assets/data/product-api-reference.json). The [TikTok Scraper API page](https://jsonscraper.com/services/tiktok-scraper-api) describes access to the service and its base address; support for `/searchVideo` in the Playground is not confirmed here.

 

The catalog is ready for the next step when it contains one record per line for the videos found, deduplicates available identifiers, and stores only returned data. Start by checking a small request and the file itself; then connect the JSONL to your processing workflow.
