Sand AISand AI MAGI-2MAGI-2 agora está na SandBase: vídeo em 1080p com áudio nativoExperimente agora

Douyin Barrage WSS XB Signature

Docs da API
https://api.sandbase.ai/v1/api/douyin/web/generate-wss-xb-signature

Returns a signed xb parameter for Douyin web barrage WebSocket connections using a specified room ID, user browser agent, and unique user identifier.

Preço
$0.001USD / chamada
Método
POST
Resposta
JSON
Parâmetros
3 obrigatórios · 0 opcionais

Playground

Entrada
Room ID
User browser agent
User unique ID
SaídaExemplo
Respostaoutputs · 67 B · 7 linhas
[
  {
    "data": {
      "x_bogus": "6M1MxCZygNhw8QPX"
    }
  }
]

Exemplos

Selecione um exemplo para carregar as entradas e o resultado no playground.

README da API

Douyin Barrage WSS XB Signature API

Returns a signature string for a Douyin live room barrage (danmaku) WebSocket connection. It needs a room_id, a browser user_agent string, and a user_unique_id.

Use cases

  • Sign a Douyin live room WebSocket URL before you open the barrage stream.
  • Generate a signature for each viewer identity when you run several chat listeners.
  • Pair the signature with the same user_agent you send in your WebSocket headers.

Request

curl -X POST "https://api.sandbase.ai/v1/api/douyin/web/generate-wss-xb-signature" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"room_id": "7382517534467115826", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0", "user_unique_id": "7382524529011246630"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
room_idstringYesRoom ID
user_agentstringYesUser browser agent
user_unique_idstringYesUser unique ID

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "x_bogus": "6kux4VFjvCR1Mnox"
}

Response fields

FieldMeaning
x_bogusThe signature string. The response holds only this one key, and its value is a short string such as 6kux4VFjvCR1Mnox.
x_bogusThe value is built from the room_id, user_agent, and user_unique_id you sent. A different input set gives a different signature.
x_bogusUse this value as the xb signature in the barrage WebSocket connection for that room.

Notes

Pricing

$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

Explorar mais

APIs relacionadas

Todas as APIs
APIPreçoResposta
Douyin$0.001 por chamadaJSON
Douyin$0.001 por chamadaJSON
Douyin$0.001 por chamadaJSON
Douyin$0.001 por chamadaJSON
Douyin$0.001 por chamadaJSON
Douyin$0.03 por chamadaJSON

Guias:Best Douyin API in 2026: Pricing Compared

Perguntas

FAQ

Como eu uso a API Douyin Barrage WSS XB Signature?

Envie uma solicitação POST para https://api.sandbase.ai/v1/api/douyin/web/generate-wss-xb-signature com sua chave de API da SandBase no cabeçalho Authorization (Bearer) e os parâmetros no corpo JSON. Você também pode testar no Playground desta página sem escrever código.

Quanto custa a API Douyin Barrage WSS XB Signature?

$0.001 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.

Quais parâmetros a API Douyin Barrage WSS XB Signature aceita?

Obrigatórios: room_id (string), user_agent (string) e user_unique_id (string). A tabela de Parâmetros e o Playground nesta página listam todos os campos.

O que a API Douyin Barrage WSS XB Signature retorna?

Uma resposta JSON retornada na mesma solicitação HTTP (síncrona). O README desta página inclui um exemplo de resposta.

Preciso de uma conta de desenvolvedor Douyin ou de uma chave de API?

Não. Douyin Barrage WSS XB Signature funciona via SandBase, então uma única chave de API da SandBase cobre este endpoint e todas as outras APIs e modelos do catálogo. Você não precisa solicitar acesso à API do Douyin separadamente.