
## Creating an Account

To use the Euler Stream API, you need an account and an API key.

<Steps>
<Step>

### Sign up

Create a free account at [eulerstream.com/register](/register). You can sign up with email or use a social login.

</Step>
<Step>

### Get your API key

After signing in, navigate to the [Dashboard](/dashboard) and create a new API key. Your API key is used to authenticate
all requests to the Euler Stream API.

</Step>
<Step>

### Start building

Use your API key with one of the supported libraries, the REST API, or the WebSocket API to start
accessing TikTok data.

</Step>
</Steps>

## Overview

The EulerStream API has official SDK libraries auto-generated from the [OpenAPI spec](/docs/api/quickstart).
These are thin wrappers around the REST API, providing type-safe methods for every endpoint.

## Available SDKs

TypeScript and Python each come as two packages: one covers the whole API, and the other is the same client with
only the TikTok LIVE groups. Their cards link to both.

<SdkCards>
  <SdkCard
    title="TypeScript"
    language="typescript"
    variants={[
      { title: "TikTok Full API", description: "tiktok-api-sdk", href: "https://www.npmjs.com/package/tiktok-api-sdk" },
      { title: "TikTok LIVE API", description: "tiktok-live-api-sdk", href: "https://www.npmjs.com/package/tiktok-live-api-sdk" },
    ]}
  />
  <SdkCard
    title="Python"
    language="python"
    variants={[
      { title: "TikTok Full API", description: "TikTokApiSdk", href: "https://pypi.org/project/TikTokApiSdk/" },
      { title: "TikTok LIVE API", description: "TikTokLiveApiSdk", href: "https://pypi.org/project/TikTokLiveApiSdk/" },
    ]}
  />
  <SdkCard title="C#" language="csharp" href="https://www.nuget.org/packages/EulerApiSdk" />
  <SdkCard title="Java" language="java" href="https://central.sonatype.com/artifact/com.eulerstream/euler-api-sdk" />
  <SdkCard title="Go" language="go" href="https://pkg.go.dev/github.com/EulerStream/Euler-Api-Sdk/sdk/go" />
  <SdkCard title="WebSocket SDK" language="websocket" href="/docs/api/client-sdks/websocket-sdk" />
</SdkCards>

## Installation

<Tabs items={["TypeScript", "Python", "C#", "Java", "Go"]}>
<Tab>

```bash
npm i tiktok-api-sdk
```

Only need TikTok LIVE? Install `tiktok-live-api-sdk` instead.

</Tab>
<Tab>

```bash
pip install TikTokApiSdk
```

Only need TikTok LIVE? Install `TikTokLiveApiSdk` instead.

</Tab>
<Tab>

```bash
dotnet add package EulerApiSdk
```

</Tab>
<Tab>

**Maven**
```xml
<dependency>
  <groupId>io.github.isaackogan</groupId>
  <artifactId>euler-api-sdk</artifactId>
</dependency>
```

**Gradle**
```groovy
implementation 'io.github.isaackogan:euler-api-sdk'
```

</Tab>
<Tab>

```bash
go get github.com/EulerStream/Euler-Api-Sdk/go-sdk
```

</Tab>
</Tabs>

## Quick Start

<Tabs items={["TypeScript", "Python", "C#", "Java", "Go"]}>
<Tab>

```ts
import TikTokApiSdk from "tiktok-api-sdk";

const client = new TikTokApiSdk({ apiKey: "YOUR_API_KEY" });

// Look up a TikTok user by @username
const res = await client.tikTokUsers.retrieveTikTokUserBasic("tv_asahi_news");
console.log(res.status, res.data);
```

With `tiktok-live-api-sdk`, import `TikTokLiveApiSdk` instead. It is created the same way.

</Tab>
<Tab>

```python
from TikTokApiSdk import AuthenticatedClient
from TikTokApiSdk.api.tik_tok_users import retrieve_tik_tok_user_basic

client = AuthenticatedClient(
    base_url="https://api.eulerstream.com",
    token="YOUR_API_KEY"
)

with client as c:
    # Look up a TikTok user by @username
    response = retrieve_tik_tok_user_basic.sync_detailed(unique_id="tv_asahi_news", client=c)
    print(response.status_code, response.parsed)
```

With the LIVE-only package, import from `TikTokLiveApiSdk` instead. It is used the same way.

</Tab>
<Tab>

```csharp
using EulerApiSdk;
using EulerApiSdk.Client;

using var client = new EulerStreamApiClient(
    host => host.AddTokens(new ApiKeyToken("YOUR_API_KEY", ClientUtils.ApiKeyHeader.ApiKey, prefix: ""))
);

var response = await client.Webcast.FetchWebcastURLAsync("ttlive-node", uniqueId: "tv_asahi_news");
Console.WriteLine(response.Ok());
```

</Tab>
<Tab>

```java
import io.github.isaackogan.EulerStreamApiClient;

EulerStreamApiClient client = EulerStreamApiClient.builder()
    .apiKey("YOUR_API_KEY")
    .build();

// Use the client
client.webcast().fetchWebcastURL("ttlive-node", null, "tv_asahi_news");
```

</Tab>
<Tab>

```go
package main

import (
  "context"
  "fmt"

  eulerstream "github.com/EulerStream/Euler-Api-Sdk/sdk/go"
)

func main() {
  client := eulerstream.NewEulerStreamClient(
    eulerstream.WithAPIKey("YOUR_API_KEY"),
  )

  hosts, _, err := client.Analytics.GetHosts(context.Background()).Execute()
  if err != nil {
    panic(err)
  }
  fmt.Println(hosts)
}
```

</Tab>
</Tabs>

## Source Code

All SDKs are open source and available on GitHub:

<Cards>
<Card title="TikTok API SDK Repository" href="https://github.com/EulerStream/TikTok-Api-Sdk">
TypeScript, Python, C#, Java, and Go SDK source code.
</Card>
<Card title="WebSocket SDK Repository" href="https://github.com/EulerStream/Euler-WebSocket-SDK">
TypeScript WebSocket SDK for real-time event streaming.
</Card>
</Cards>
