# TikTok Profile API

Each successful request will cost you **`5`** API credits.&#x20;

You have to send a GET request to **`https://api.scrapingdog.com/tiktok/profile`** with the below-given parameters.

### Parameters <a href="#parameters" id="parameters"></a>

#### **Scrapingdog Parameters**

| Parameter                                                       | Description                                                                                              |
| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| <p>api\_key<br><br><mark style="color:red;">required</mark></p> | <p>Your personal API key. Available on your dashboard <br><br>Type: <em><strong>String</strong></em></p> |

#### Search Query

| Parameter                                                       | Description                                                                                       |
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| <p>username<br><br><mark style="color:red;">required</mark></p> | <p>This is the username of the TikTok profile. <br><br>Type: <em><strong>String</strong></em></p> |

### API Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl "https://api.scrapingdog.com/tiktok/profile?api_key=APIKEY&username=nike"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

api_key = 'APIKEY'
username = 'nike'


params = {
    'api_key': api_key,
    'username': username
}

response = requests.get('https://api.scrapingdog.com/tiktok/profile', params=params)

if response.status_code == 200:
    # Parse the JSON response using response.json()
    response_data = response.json()
    
    # Now you can work with the response_data as a Python dictionary
    print(response_data)
else:
    print(f'Request failed with status code: {response.status_code}')

```

{% endtab %}

{% tab title="Node JS" %}

```javascript
const axios = require('axios');

const api_key = 'APIKEY';
const username = 'nike';


const params = {
  api_key,
  username
};

axios
  .get('https://api.scrapingdog.com/tiktok/profile', { params })
  .then((response) => {
    if (response.status === 200) {
      // Parse the JSON response
      const responseData = response.data;
      console.log(responseData);
    } else {
      console.error(`Request failed with status code: ${response.status}`);
    }
  })
  .catch((error) => {
    console.error('An error occurred:', error);
  });

```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'httparty'
require 'json'

api_key = 'APIKEY'
username = 'nike'


# Define the API endpoint
endpoint = 'https://api.scrapingdog.com/tiktok/profile'

# Create a hash with the query parameters
params = {
  api_key: api_key,
  username : username
}

# Make the GET request
response = HTTParty.get(endpoint, query: params)

# Check the HTTP response code
if response.code == 200
  # Parse the JSON response
  parsed_response = JSON.parse(response.body)
  puts parsed_response
else
  puts "Request failed with status code: #{response.code}"
end

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$api_key = 'APIKEY';
$username = 'nike';


// Create an array with the query parameters
$params = array(
    'api_key' => $api_key,
    'username' => $username
);

// Initialize cURL session
$ch = curl_init('https://api.scrapingdog.com/tiktok/profile?' . http_build_query($params));

// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the cURL request
$response = curl_exec($ch);

// Check for cURL errors
if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch);
} else {
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($httpCode === 200) {
        // Parse the JSON response
        $responseData = json_decode($response, true);
        print_r($responseData);
    } else {
        echo 'Request failed with status code: ' . $httpCode;
    }
}

// Close cURL session
curl_close($ch);
?>

```

{% endtab %}

{% tab title="Java" %}

```java
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import org.json.JSONObject;

public class TwitterApiExample {
    public static void main(String[] args) {
        String api_key = "APIKEY";
        String username = "nike";


        String endpoint = "https://api.scrapingdog.com/tiktok/profile";
        
        OkHttpClient client = new OkHttpClient();
        Request request = new Request.Builder()
                .url(endpoint + "?api_key=" + api_key + "&username=" + username)
                .get()
                .build();

        try {
            Response response = client.newCall(request).execute();
            ResponseBody responseBody = response.body();

            if (response.isSuccessful() && responseBody != null) {
                String jsonString = responseBody.string();
                JSONObject jsonResponse = new JSONObject(jsonString);
                System.out.println(jsonResponse.toString(4)); // Pretty print the JSON response
            } else {
                System.err.println("Request failed with status code: " + response.code());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

```

{% endtab %}
{% endtabs %}

### API Response

```json
{
  "id": "208464585232822272",
  "short_id": null,
  "username": "nike",
  "nickname": "Nike",
  "profile_url": "https://www.tiktok.com/@nike",
  "bio": "Just Do It.",
  "sec_uid": "MS4wLjABAAAA_3ndMt8d_tECTdpKgCxcx238tOnQZX-20wqN01aMui5zQ7hsqSdff-jC5qYC-Cl_",
  "avatar_thumb": "https://p16-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:100:100.jpeg?dr=9640&refresh_token=a101ac6e&x-expires=1777032000&x-signature=CqdRMOnpUvUXQOcgfeAxIRLFsvs%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=useast8",
  "avatar_medium": "https://p16-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:720:720.jpeg?dr=9640&refresh_token=ad86b399&x-expires=1777032000&x-signature=JlVz9Li7bTlZo1h6XiYMOpGNcLg%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=useast8",
  "avatar_large": "https://p16-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/e0b0ac7b6ad6447a8e923fd1eb162f2c~tplv-tiktokx-cropcenter:1080:1080.jpeg?dr=9640&refresh_token=1926aed6&x-expires=1777032000&x-signature=fpf7JnumAS2MoVfvN4oUK5ydZw8%3D&t=4d5b0474&ps=13740610&shp=a5d48078&shcp=81f88b70&idc=useast8",
  "verified": true,
  "private_account": false,
  "is_secret": false,
  "is_commerce_account": true,
  "commerce_category": "Sports, Fitness & Outdoors",
  "is_seller": false,
  "is_organization": true,
  "is_ad_virtual": false,
  "is_embed_banned": false,
  "ftc": false,
  "bio_link": "http://empli.fi/niketiktok",
  "region": null,
  "language": "en",
  "created_at": 1490044565,
  "created_at_iso": "2017-03-20T21:16:05.000Z",
  "username_last_changed_at": null,
  "nickname_last_changed_at": null,
  "followers": 8423473,
  "following": 75,
  "likes": 42509003,
  "video_count": 1072,
  "digg_count": 0,
  "friend_count": 38,
  "duet_setting": 0,
  "stitch_setting": 0,
  "comment_setting": 0,
  "download_setting": 0,
  "following_visibility": 2,
  "open_favorite": false,
  "relation": 0,
  "profile_tabs": {
    "music": false,
    "questions": true,
    "playlists": true,
    "can_expand_playlist": true
  },
  "is_live": false,
  "room_id": null,
  "recommend_reason": null,
  "canonical_url": "https://www.tiktok.com/@nike",
  "share_title": "Nike on TikTok",
  "share_desc": "@nike 8.4m Followers, 75 Following, 42.5m Likes - Watch awesome short videos created by Nike"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.scrapingdog.com/tiktok-scraper-api-documentation/tiktok-profile-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
