A marketer may find a TikTok video whose creator discusses a relevant product, but turning that signal into a verifiable contact is harder: the creator’s TikTok and IG names may differ, and a profile may be private or have no confirmed connection to the person. The practical outcome is not an automated list of “ready-to-contact leads,” but a review table containing the original video, TikTok creator, proposed IG username, API response, and status for further review.
Below is a minimal Python workflow for this task. It searches for public videos by keyword, extracts available creator fields, and checks IG profiles only when you already have a username with a reasonable basis for checking. The API can retrieve profile data by username; it does not automatically establish that two accounts belong to the same person.
What to automate
Imagine a team that sells home coffee equipment and wants to find creators of public videos about making drinks. Manual search is useful for an initial look at the content, but repeating it makes it difficult to preserve which video led to a contact, where the profile name came from, and exactly what was checked.

The pipeline separates three actions: searching TikTok videos, saving observable data, and checking a proposed IG profile. This lets an analyst open one CSV file and see the origin of each candidate. IG fields should be filled in only after the username has been found in a public bio or creator link, or a person has verified it using other available materials.
This approach is useful for an agency, research team, or in-house marketer who needs a small, reproducible list for manual qualification. It preserves the context of each discovery and does not turn similar names into a claim of identity.
Fields you can retrieve
TikTok’s documented /searchVideo route requires the keyword parameter; count, date_posted, sort_by, region, and cursor are also available. Observed responses include a video ID, description, posting date, URL, creator data, and public engagement counts. The actual set of fields may vary, so the code below uses safe reads with empty-value defaults.
This workflow uses IG’s documented GET route /v1/user/by/username with the username parameter. A response may contain the username, display name, privacy and verification status, post, follower, and following counts, as well as a bio. These are details for a specialist to review and use in a subsequent decision, not a score for the creator.
The official TikTok API documentation describes search parameters, while the IG API documentation describes IG methods and parameters. jsonscraper’s built-in API definitions also specify routes, parameter names, and observed response formats; the checks cited here were conducted on October 25, 2026.
Set up keys and the candidate list
Store API keys in the environment variables JSONSCRAPER_TIKTOK_LICENSE_KEY and JSONSCRAPER_INSTAGRAM_LICENSE_KEY. Do not put them in source code, CSV files, or job logs. Install the requests library with python -m pip install requests. The following example is for Python 3.8 and later.
import csv
import os
import sys
from urllib.parse import urlencode
import requests
TIKTOK_KEY = os.environ.get("JSONSCRAPER_TIKTOK_LICENSE_KEY")
INSTAGRAM_KEY = os.environ.get("JSONSCRAPER_INSTAGRAM_LICENSE_KEY")
if not TIKTOK_KEY or not INSTAGRAM_KEY:
sys.exit("Set JSONSCRAPER_TIKTOK_LICENSE_KEY and JSONSCRAPER_INSTAGRAM_LICENSE_KEY")
def get_json(base_url, path, params):
response = requests.get(
f"{base_url}{path}",
params=params,
timeout=30,
)
response.raise_for_status()
return response.json()
def extract_videos(payload):
"""Handle both observed TikTok search result locations."""
if payload.get("status") != "ok":
raise RuntimeError(f"TikTok API status: {payload.get('status')}")
tiktok = payload.get("tiktok") or {}
videos = list(tiktok.get("aweme_list") or [])
for item in tiktok.get("search_item_list") or []:
video = item.get("aweme_info")
if video:
videos.append(video)
unique = {}
for video in videos:
video_id = video.get("aweme_id")
if video_id:
unique[video_id] = video
return list(unique.values())
keyword = "домашний кофе"
tiktok_payload = get_json(
"https://tiktok.evelode.com",
"/searchVideo",
{
"license_key": TIKTOK_KEY,
"keyword": keyword,
"count": 20,
"date_posted": "this-month",
"sort_by": "relevance",
},
)
rows = []
for video in extract_videos(tiktok_payload):
author = video.get("author") or {}
stats = video.get("statistics") or {}
rows.append({
"tiktok_video_id": video.get("aweme_id", ""),
"tiktok_url": video.get("share_url", ""),
"video_description": video.get("desc", ""),
"created_at": video.get("create_time", ""),
"tiktok_username": author.get("unique_id", ""),
"tiktok_author_name": author.get("nickname", ""),
"tiktok_followers": author.get("follower_count", ""),
"views": stats.get("play_count", ""),
"likes": stats.get("digg_count", ""),
"instagram_username": "",
"instagram_status": "not checked",
"instagram_followers": "",
"instagram_is_private": "",
"manual_match_review": "required",
})
# Fill this dictionary only with usernames found separately
# and entered after manually checking the source.
verified_instagram_usernames = {
# "tiktok_video_id": "instagram_username"
}
for row in rows:
username = verified_instagram_usernames.get(row["tiktok_video_id"])
if not username:
continue
ig_payload = get_json(
"https://ig.jsonscraper.com",
"/v1/user/by/username",
{
"license_key": INSTAGRAM_KEY,
"username": username,
},
)
if ig_payload.get("status") != "ok":
row["instagram_status"] = "api status: " + str(ig_payload.get("status"))
continue
profile = ig_payload.get("ig") or {}
row["instagram_username"] = profile.get("username", username)
row["instagram_status"] = "profile returned"
row["instagram_followers"] = profile.get("follower_count", "")
row["instagram_is_private"] = profile.get("is_private", "")
row["manual_match_review"] = "check relationship manually"
if rows:
with open("social_lead_checks.csv", "w", newline="", encoding="utf-8") as f:
writer = csv.DictWriter(f, fieldnames=rows[0].keys())
writer.writeheader()
writer.writerows(rows)
else:
print("No video rows returned for this query.")
Why the handler accounts for two response structures
TikTok search results can contain videos in two locations: tiktok.aweme_list and tiktok.search_item_list[].aweme_info. In an observed search response, the first list could be empty while items appeared in the second. The example therefore combines both sources and removes duplicates by aweme_id. It first checks the top-level status, then reads the tiktok object.

The code saves only fields that are actually present in the response. An empty value means the field was missing from the returned object; it should not be interpreted as a zero. Saving video links and descriptions alongside metrics is useful: otherwise, the table loses its original context when reviewed later.
Add pagination only when needed
The example requests one page and processes only the returned items. If you need to continue searching, the documentation provides cursor for video search; its value comes from the previous response. Treat the cursor as an opaque value and pass it along without calculating it yourself. Stop the loop when the response indicates that there are no more results, or when you reach a limit set by your team. Pagination expands the set of returned results, but does not justify calling it comprehensive coverage of every post on the topic.
Before adding an automated export, check an actual response using your key and choose a moderate number of pages. Store the original JSON alongside the normalized row or separately by run date: this makes it possible to determine whether a response field has changed and to reprocess the collection if the schema changes.
Use the CSV for qualification
You can filter the table by whether a video link, description, creator, and IG profile are present. Useful statuses for an initial review queue include “video found,” “IG username found,” “profile returned,” “account relationship verified by a person,” and “excluded.” These statuses describe the review process, not the creator’s quality or intent.
If the task requires a repeatable report, run the script on a schedule and add the data retrieval date in a separate column. Comparing snapshots will then show what changed between runs in the available fields, such as a profile’s follower count. Store TikTok and IG metrics separately, with the platform and observation time specified: they represent different contexts and different API responses.
For a larger workflow, replace CSV with a database that uses the platform and video ID as a composite key. Save the original text query, collection time, and raw response. Send a Slack notification or pass a row to a CRM only after manually confirming the profile relationship, not immediately after a name match.
Interpretation limits and safe operation
A keyword search returns results found by the API, not a complete list of posts. View, like, and follower counts are snapshots taken at the time of the request. They can be used to sort a working list and conduct further checks, but do not by themselves confirm commercial intent, audience, or consent to contact.
Confirm profile relationships using explicit public signals, and record who conducted the check and when. If an IG username came from a third-party spreadsheet without a verifiable source, leave its status as “requires review.” A private profile or missing data should appear as a distinct verification result, without attempts to fill the gap with an assumption.
Use keys in your work environment’s secret store, restrict access to exports, and set a retention period appropriate to the research purpose. Send only the fields needed for further manual work to the CRM, and follow applicable platform rules and data-processing requirements.
What you’ll get
After running the script, you’ll have a CSV containing discovered videos, creators, and available metrics, along with separate fields for IG checks. You can run the script manually, on a CI schedule, or through an HTTP request node in an automation platform. The key practical principle is to automate data collection and structure while keeping the determination of account relationships as a verifiable human step.
To check routes and available parameters, start with the TikTok Scraper API and the IG Scraper API. Their product pages provide request examples and links to documentation; begin with a small request before incorporating collection into an ongoing workflow.