> For the complete documentation index, see [llms.txt](https://kitkot-io-organization.gitbook.io/kitkot-api-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kitkot-io-organization.gitbook.io/kitkot-api-documentation/information/retrieving-tiktok-ids.md).

# Retrieving TikTok IDs

Documentation on how to retrieve different type of TikTok IDs using our API

Now that you know the different kind of IDs, lets move onto how to retrieve them using our API by a username/unique\_id.

## Returns various ids from the username

<mark style="color:blue;">`GET`</mark> `https://kitkot.xyz/api/get_user_ids`

Returns `sec_user_id` `user_id` from the username/unique\_id, will also return `room_id` if the user is currently live.

#### Query Parameters

| Name                                       | Type   | Description                                      |
| ------------------------------------------ | ------ | ------------------------------------------------ |
| api\_key<mark style="color:red;">\*</mark> | String | The api\_key you got when purchasing our service |
| id<mark style="color:red;">\*</mark>       | String | The unique\_id/username of the user              |

{% tabs %}
{% tab title="200: OK USER\_FOUND\_SUCCESSFULLY" %}
{% code overflow="wrap" lineNumbers="true" %}

```json
}
  "code": 200,
  "sec_user_id": "MS4wLjABAAAAv7iSuuXDJGDvJkmH_vz1qkDZYo1apxgzaxdBSeIuPiM",
  "user_id": "107955"
}
```

{% endcode %}
{% endtab %}

{% tab title="404: Not Found USER\_FOUND\_FAILED" %}

```json
{
  "code": 404,
  "msg": "User does not exist"
}
```

{% endtab %}

{% tab title="400: Bad Request BAD\_REQUEST" %}

```json
{
  "code": 400,
  "msg": "id parameter exceeds length of 24"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="NodeJS" %}
{% code overflow="wrap" lineNumbers="true" %}

```javascript
const fetch = require('node-fetch');

const BASEURL = "https://kitkot.xyz/api";
const API_KEY = "my-api-key";
const username = "tiktok";

const request = await fetch(`${BASEURL}/get_user_ids?api_key=${API_KEY}&id=${username}`);
const response = await request.json();
console.log(response);
```

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code overflow="wrap" lineNumbers="true" %}

```python
import requests

BASEURL = "https://kitkot.xyz/api"
API_KEY = "my-api-key"
username = "tiktok"

request = requests.get(f"{BASEURL}/get_user_ids?api_key={API_KEY}&id={username}")
response = request.json()
print(response)
```

{% endcode %}
{% endtab %}
{% endtabs %}

**Description:**&#x20;

The query args can be seen in the text and since there is no body its gonna be a GET request and if session required? is true there should be a session\_key in the query args as well otherwise it can be ignored.and it will return ids.
