> ## Documentation Index
> Fetch the complete documentation index at: https://docs.osintcat.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Twitch Profile

> Public Twitch profile by username

Look up a Twitch account by its username and get the public profile.

## Parameters

**username** `string` *required*

The Twitch username.

## Headers

**X-API-KEY** `string` *required*

Your API key.

## Usage

Counts as one lookup against your plan's daily allowance (Max: unlimited). When the allowance is used up, the lookup can continue at a per-lookup price charged to your balance (the module's page in the dashboard shows the price). The price applies even when the lookup finds nothing; a lookup that fails because of an error on our side is not charged.

## Example request

```bash cURL theme={null}
curl "https://www.osintcat.net/api/twitch?username=xqc" \
     -H "X-API-KEY: YOUR_API_KEY"
```

```python Python theme={null}
import requests

url = "https://www.osintcat.net/api/twitch"
params = {"username": "xqc"}
headers = {"X-API-KEY": "YOUR_API_KEY"}

response = requests.get(url, params=params, headers=headers, timeout=60)
print(response.status_code, response.json())
```

```javascript JS & TS theme={null}
const response = await fetch("https://www.osintcat.net/api/twitch?username=xqc", {
  headers: { "X-API-KEY": "YOUR_API_KEY" },
});
console.log(response.status, await response.json());
```

```php PHP theme={null}
<?php
$curl = curl_init("https://www.osintcat.net/api/twitch?username=xqc");
curl_setopt_array($curl, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ["X-API-KEY: YOUR_API_KEY"],
]);
$response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
curl_close($curl);
echo $status . " " . $response;
```

```go Go theme={null}
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://www.osintcat.net/api/twitch?username=xqc", nil)
    req.Header.Set("X-API-KEY", "YOUR_API_KEY")
    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(resp.StatusCode, string(body))
}
```

## SDK example

The same request with the [official SDKs](https://docs.osintcat.net/sdks.md). Each one reads your key from `OSINTCAT_API_KEY`.

```typescript JS & TS theme={null}
import { OsintCatClient } from "osintcat";

const client = new OsintCatClient(); // reads OSINTCAT_API_KEY

const result = await client.twitch.profile({
    username: "xqc"
});
console.log(result);
```

```python Python theme={null}
from osintcat import OsintCat

client = OsintCat()  # reads OSINTCAT_API_KEY

result = client.twitch.profile(
    username="xqc",
)
print(result)
```

```go Go theme={null}
package main

import (
	"context"
	"fmt"

	osintcat "github.com/OsintCatHQ/osintcat-go"
	osintcatclient "github.com/OsintCatHQ/osintcat-go/client"
)

func main() {
	client := osintcatclient.NewClient() // reads OSINTCAT_API_KEY
	request := &osintcat.ProfileTwitchRequest{
		Username: "xqc",
	}
	result, err := client.Twitch.Profile(context.Background(), request)
	if err != nil {
		panic(err)
	}
	fmt.Printf("%+v\n", result)
}
```

```php PHP theme={null}
<?php
require __DIR__ . '/vendor/autoload.php';

use OsintCat\OsintCatClient;
use OsintCat\Twitch\Requests\ProfileTwitchRequest;

$client = new OsintCatClient(); // reads OSINTCAT_API_KEY

$result = $client->twitch->profile(
    new ProfileTwitchRequest([
        'username' => 'xqc',
    ]),
);
echo json_encode($result, JSON_PRETTY_PRINT), PHP_EOL;
```

## Response

`taken` is `true` when the account exists. `ExtraData` holds what the profile shows publicly; a field the profile does not have is left out. When the lookup could not be completed, `taken` is `false` and `error` says why (for example `rate_limited`, try again later).

**taken** `boolean`

Whether an account with this username exists.

**error** `string`

Present only when the lookup could not be completed.

**ExtraData** `object`

Public profile fields.

**properties**

**Username** `string`

Login name.

**DisplayName** `string`

Display name.

**UserID** `string`

Twitch user ID.

**Description** `string`

Bio.

**ProfilePicUrl** `string`

Profile picture.

**Followers** `number`

Followers.

**CreatedAt** `string`

Account creation.

**BroadcasterType** `string`

`partner`, `affiliate` or empty.

**Banned** `boolean`

Whether the account is suspended (`BanReason` then says why).

**IsPartner** `boolean`

Twitch partner.

**IsAffiliate** `boolean`

Twitch affiliate.

**ProfileUrl** `string`

Channel link.

```json 200 theme={null}
{
  "taken": true,
  "ExtraData": {
    "Username": "xqc",
    "DisplayName": "xQc",
    "UserID": "71092938",
    "Followers": 12345678,
    "CreatedAt": "2014-09-12T23:50:05Z",
    "BroadcasterType": "partner",
    "Banned": false,
    "ProfileUrl": "https://twitch.tv/xqc"
  }
}
```

## Errors

| Status | Error | When |
| - | - | - |
| 400 | `Missing username parameter` | No `username` given. |

See [Errors](https://docs.osintcat.net/api-reference/introduction.md#errors) for the responses every endpoint can return.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.