Resolve a hashtag into the challenge behind it. Pass the challenge name and the endpoint returns its record: the numeric challenge ID, description, cover artwork and whether TikTok flags the tag as commercial, together with the usage figures that show how much traffic it carries. The ID that comes back is exactly what challenge-posts needs to list the videos.
curl -X GET "https://api.primeapi.co/challenge-info?challengeName=cat" \
-H "X-PrimeAPI-Key: YOUR_API_KEY"
import requests
url = "https://api.primeapi.co/challenge-info?challengeName=cat"
headers = {"X-PrimeAPI-Key": "YOUR_API_KEY"}
response = requests.get(url, headers=headers)
print(response.json())
print("Credits left:", response.headers.get("X-PrimeAPI-Balance"))
{
"challengeInfo": {
"challenge": {
"coverLarger": "",
"coverMedium": "",
"coverThumb": "",
"desc": "",
"id": "7551",
"isCommerce": false,
"profileLarger": "https://p77-va.tiktokcdn.com/obj/musically-maliva-obj/2e13829d6e1816708244b2bc8b905c51?shp=81f88b70&shcp=-",
"profileMedium": "https://p77-va.tiktokcdn.com/obj/musically-maliva-obj/2e13829d6e1816708244b2bc8b905c51?shp=81f88b70&shcp=-",
"profileThumb": "https://p77-va.tiktokcdn.com/obj/musically-maliva-obj/2e13829d6e1816708244b2bc8b905c51?shp=81f88b70&shcp=-",
"stats": {
"videoCount": 0,
"viewCount": 753500000000
},
"title": "cat"
},
"challengeAnnouncement": {
"body": "",
"title": ""
},
"stats": {
"videoCount": 0,
"viewCount": 753500000000
},
"statsV2": {
"videoCount": "54678836",
"viewCount": "753506814168"
}
},
"extra": {
"fatal_item_ids": [],
"logid": "20250118002106A7EF00F2DD0A4F443CDB",
"now": 1737159667000
},
"log_pb": {
"impr_id": "20250118002106A7EF00F2DD0A4F443CDB"
},
"shareMeta": {
"desc": "753500.0m views - Watch awesome short videos created with trending hashtag #cat",
"title": "#cat on TikTok"
},
"statusCode": 0,
"status_code": 0,
"status_msg": ""
}