TikTok

TikTok profile

API Link: https://scraper-api.smartproxy.com/v1/scrape

  POST /scrape

Payload type: JSON

Required parameters:
url (in this example, https://www.tiktok.com/@nba)
target (in this example, tiktok_profile)

ParameterTypeDescription
urlurlTikTok profile URL
targetstringtarget
localestringlanguage locale
geostringgeolocation
curl -u username:password -X POST --url https://scraper-api.smartproxy.com/v1/scrape -H "Content-Type: application/json" -d "{\"url\": \"https://www.tiktok.com/@nba\", \"target\": \"tiktok_profile\",\"locale\": \"en-us\",\"geo\": \"United States\" }"
import requests

headers = {
    'Content-Type': 'application/json'
}

task_params = {
    'url': 'https://www.tiktok.com/@nba',
    'target': 'tiktok_profile',
    'locale': 'en-us',
    'geo': 'United States'
}

username = 'username'
password = 'password'
  
response = requests.post(
    'https://scraper-api.smartproxy.com/v1/scrape',
    headers = headers,
    json = task_params,
    auth = (username, password)
)
print(response.text)
<?php

$params = array(
    'url' => 'https://www.tiktok.com/@nba',
    'target' => 'tiktok_profile',
    'locale' => 'en-us',
    'geo' => 'United States'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://scraper-api.smartproxy.com/v1/scrape');
curl_setopt($ch, CURLOPT_USERPWD, 'username' . ':' . 'password');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);

$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
echo $result;

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
?>

TikTok post

API Link: https://scraper-api.smartproxy.com/v1/scrape

  POST /scrape

Payload type: JSON

Required parameters:
url (in this example, https://www.tiktok.com/@nba/video/7196793231042989354)
target (in this example, tiktok_post)

ParameterTypeDescription
urlurlTikTok post URL
targetstringtarget
localestringlanguage locale
geostringgeolocation
curl -u username:password -X POST --url https://scraper-api.smartproxy.com/v1/scrape -H "Content-Type: application/json" -d "{\"url\": \"https://www.tiktok.com/@nba/video/7196793231042989354\", \"target\": \"tiktok_post\",\"locale\": \"en-us\",\"geo\": \"United States\" }"
import requests

headers = {
    'Content-Type': 'application/json'
}

task_params = {
    'url': 'https://www.tiktok.com/@nba/video/7196793231042989354',
    'target': 'tiktok_post',
    'locale': 'en-us',
    'geo': 'United States'
}

username = 'username'
password = 'password'
  
response = requests.post(
    'https://scraper-api.smartproxy.com/v1/scrape',
    headers = headers,
    json = task_params,
    auth = (username, password)
)
print(response.text)
<?php

$params = array(
    'url' => 'https://www.tiktok.com/@nba/video/7196793231042989354',
    'target' => 'tiktok_post',
    'locale' => 'en-us',
    'geo' => 'United States'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://scraper-api.smartproxy.com/v1/scrape');
curl_setopt($ch, CURLOPT_USERPWD, 'username' . ':' . 'password');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);

$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
echo $result;

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
?>

TikTok hashtag

API Link: https://scraper-api.smartproxy.com/v1/scrape

  POST /scrape

Payload type: JSON

Required parameters:
url (in this example, https://www.tiktok.com/tag/satisfying)
target (in this example, tiktok_hashtag)

ParameterTypeDescription
urlurlTikTok hashtag URL
targetstringtarget
localestringlanguage locale
geostringgeolocation
curl -u username:password -X POST --url https://scraper-api.smartproxy.com/v1/scrape -H "Content-Type: application/json" -d "{\"url\": \"https://www.tiktok.com/tag/satisfying\", \"target\": \"tiktok_hashtag\",\"locale\": \"en-us\",\"geo\": \"United States\" }"
import requests

headers = {
    'Content-Type': 'application/json'
}

task_params = {
    'url': 'https://www.tiktok.com/tag/satisfying',
    'target': 'tiktok_hashtag',
    'locale': 'en-us',
    'geo': 'United States'
}

username = 'username'
password = 'password'
  
response = requests.post(
    'https://scraper-api.smartproxy.com/v1/scrape',
    headers = headers,
    json = task_params,
    auth = (username, password)
)
print(response.text)
<?php

$params = array(
    'url' => 'https://www.tiktok.com/tag/satisfying',
    'target' => 'tiktok_hashtag',
    'locale' => 'en-us',
    'geo' => 'United States'
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://scraper-api.smartproxy.com/v1/scrape');
curl_setopt($ch, CURLOPT_USERPWD, 'username' . ':' . 'password');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);

$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
echo $result;

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
?>

Asynchronous requests

Asynchronous requests do not require you to keep an open connection and let you retrieve the scraped data later. To learn more, take a look at this article.