A busca carrega apenas quando você a usa. Explore todas as categorias abaixo.

Análises e insights

Consultar desempenho público

Consulte contadores públicos não oficiais do X de uma conta conectada ao espaço de trabalho. Contadores ausentes continuam indisponíveis; não são usados a X API paga nem credenciais.

POST /analytics-api/public-performance/read

Contrato revisado: · sha256:6a53c6b98f970cf0

Visão geral

Consulte contadores públicos não oficiais do X de uma conta conectada ao espaço de trabalho. Contadores ausentes continuam indisponíveis; não são usados a X API paga nem credenciais.

Uma resposta HTTP bem-sucedida pode significar que uma requisição foi aceita, não concluída. Para trabalho em segundo plano, salve o ID retornado e consulte a mesma operação até terminar. Um post agendado ou aceito só está publicado quando a plataforma confirma; um timeout do cliente não comprova o resultado.

Autenticação e permissões

Classes de credenciais aceitas
user_session, delegated_oauth, personal_access_token
Capacidade delegada
agent:operate
Função mínima no workspace
viewer
Escopo de acesso
Recursos que este usuário tem autorização para acessar
Consentimento para todos os workspaces obrigatório
Não
Altera o estado
Não
Quando a operação estiver concluída
explicitly unofficial public counters or unavailable evidence; never official Insights

Um token só pode usar os direitos do seu proprietário. Cada requisição verifica participação no workspace, propriedade de recursos, workspaces selecionados e capacidades concedidas. Os perfis core e full mudam as ferramentas exibidas; não concedem acesso.

Campos da requisição

Obrigatório significa obrigatório dentro do objeto pai e da ramificação selecionada. Um filho obrigatório não torna obrigatório um pai opcional. As regras e nomes de campos abaixo são copiados do contrato.

Campos da requisição
Campo / ramificaçãoTipo / obrigatórioRestrições
$objectObrigatório no objeto pai
  • additionalProperties: false
workspace_idstringObrigatório no objeto pai
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
social_account_idstringObrigatório no objeto pai
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
cursorstringOpcional / item
  • minLength: 1
  • maxLength: 2048
refreshbooleanOpcional / item—
JSON Schema completo
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "social_account_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "cursor": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2048
    },
    "refresh": {
      "type": "boolean"
    }
  },
  "required": [
    "workspace_id",
    "social_account_id"
  ],
  "additionalProperties": false
}

Resposta e conclusão

Códigos HTTP de sucesso: 200. Quando a operação estiver concluída: explicitly unofficial public counters or unavailable evidence; never official Insights.

Uma resposta HTTP bem-sucedida pode significar que uma requisição foi aceita, não concluída. Para trabalho em segundo plano, salve o ID retornado e consulte a mesma operação até terminar. Um post agendado ou aceito só está publicado quando a plataforma confirma; um timeout do cliente não comprova o resultado.

Obrigatório significa obrigatório dentro do objeto pai e da ramificação selecionada. Um filho obrigatório não torna obrigatório um pai opcional. As regras e nomes de campos abaixo são copiados do contrato.

Resposta e conclusão
Campo / ramificaçãoTipo / obrigatórioRestrições
$objectObrigatório no objeto pai—
contract_versionstringObrigatório no objeto pai
  • const: "public-performance/v1"
sourcestringObrigatório no objeto pai
  • const: "fxtwitter"
source_kindstringObrigatório no objeto pai
  • const: "unofficial_public"
platformstringObrigatório no objeto pai
  • const: "x"
workspace_idstringObrigatório no objeto pai
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
social_account_idstringObrigatório no objeto pai
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
provider_account_idstringObrigatório no objeto pai
  • pattern: "^\\d{2,20}$"
fetched_atstringObrigatório no objeto pai
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
upstream_updated_atnullObrigatório no objeto pai—
expires_atstringObrigatório no objeto pai
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
cache_statusstringObrigatório no objeto pai
  • enum: ["hit","stored","bypassed"]
statusstringObrigatório no objeto pai
  • enum: ["available","partial","unavailable"]
profileobject | nullObrigatório no objeto pai—
profileanyOf 1objectObrigatório no objeto pai—
profile.nameanyOf 1stringObrigatório no objeto pai
  • maxLength: 200
profile.handleanyOf 1stringObrigatório no objeto pai
  • maxLength: 100
profile.followersanyOf 1integer | nullObrigatório no objeto pai—
profile.followersanyOf 1 / anyOf 1integerObrigatório no objeto pai
  • minimum: 0
  • maximum: 9007199254740991
profile.followersanyOf 1 / anyOf 2nullObrigatório no objeto pai—
profileanyOf 2nullObrigatório no objeto pai—
postsarrayObrigatório no objeto pai
  • maxItems: 100
posts[]objectOpcional / item—
posts[].idstringObrigatório no objeto pai
  • pattern: "^\\d{2,20}$"
posts[].urlstringObrigatório no objeto pai
  • format: "uri"
posts[].textstringObrigatório no objeto pai
  • maxLength: 30000
posts[].published_atstring | nullObrigatório no objeto pai—
posts[].published_atanyOf 1stringObrigatório no objeto pai
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
posts[].published_atanyOf 2nullObrigatório no objeto pai—
posts[].kindstringObrigatório no objeto pai
  • enum: ["post","reply"]
posts[].media_kindstringObrigatório no objeto pai
  • enum: ["text","image","video"]
posts[].metricsobjectObrigatório no objeto pai—
posts[].metrics.viewsinteger | nullObrigatório no objeto pai—
posts[].metrics.viewsanyOf 1integerObrigatório no objeto pai
  • minimum: 0
  • maximum: 9007199254740991
posts[].metrics.viewsanyOf 2nullObrigatório no objeto pai—
posts[].metrics.likesinteger | nullObrigatório no objeto pai—
posts[].metrics.likesanyOf 1integerObrigatório no objeto pai
  • minimum: 0
  • maximum: 9007199254740991
posts[].metrics.likesanyOf 2nullObrigatório no objeto pai—
posts[].metrics.repliesinteger | nullObrigatório no objeto pai—
posts[].metrics.repliesanyOf 1integerObrigatório no objeto pai
  • minimum: 0
  • maximum: 9007199254740991
posts[].metrics.repliesanyOf 2nullObrigatório no objeto pai—
posts[].metrics.repostsinteger | nullObrigatório no objeto pai—
posts[].metrics.repostsanyOf 1integerObrigatório no objeto pai
  • minimum: 0
  • maximum: 9007199254740991
posts[].metrics.repostsanyOf 2nullObrigatório no objeto pai—
posts[].metrics.quotesinteger | nullObrigatório no objeto pai—
posts[].metrics.quotesanyOf 1integerObrigatório no objeto pai
  • minimum: 0
  • maximum: 9007199254740991
posts[].metrics.quotesanyOf 2nullObrigatório no objeto pai—
posts[].metrics.bookmarksinteger | nullObrigatório no objeto pai—
posts[].metrics.bookmarksanyOf 1integerObrigatório no objeto pai
  • minimum: 0
  • maximum: 9007199254740991
posts[].metrics.bookmarksanyOf 2nullObrigatório no objeto pai—
coverageobjectObrigatório no objeto pai—
coverage.completebooleanObrigatório no objeto pai—
coverage.next_cursorstring | nullObrigatório no objeto pai—
coverage.next_cursoranyOf 1stringObrigatório no objeto pai
  • maxLength: 2048
coverage.next_cursoranyOf 2nullObrigatório no objeto pai—
coverage.views_available_postsintegerObrigatório no objeto pai
  • minimum: 0
  • maximum: 9007199254740991
coverage.omitted_rowsintegerObrigatório no objeto pai
  • minimum: 0
  • maximum: 9007199254740991
coverage.reasonsarrayObrigatório no objeto pai
  • maxItems: 8
coverage.reasons[]stringOpcional / item
  • maxLength: 300
JSON Schema completo
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contract_version": {
      "type": "string",
      "const": "public-performance/v1"
    },
    "source": {
      "type": "string",
      "const": "fxtwitter"
    },
    "source_kind": {
      "type": "string",
      "const": "unofficial_public"
    },
    "platform": {
      "type": "string",
      "const": "x"
    },
    "workspace_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "social_account_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "provider_account_id": {
      "type": "string",
      "pattern": "^\\d{2,20}$"
    },
    "fetched_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "upstream_updated_at": {
      "type": "null"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "cache_status": {
      "type": "string",
      "enum": [
        "hit",
        "stored",
        "bypassed"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "available",
        "partial",
        "unavailable"
      ]
    },
    "profile": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "maxLength": 200
            },
            "handle": {
              "type": "string",
              "maxLength": 100
            },
            "followers": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "name",
            "handle",
            "followers"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "posts": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^\\d{2,20}$"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "text": {
            "type": "string",
            "maxLength": 30000
          },
          "published_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "post",
              "reply"
            ]
          },
          "media_kind": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "video"
            ]
          },
          "metrics": {
            "type": "object",
            "properties": {
              "views": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "likes": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "replies": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reposts": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "quotes": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "bookmarks": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "views",
              "likes",
              "replies",
              "reposts",
              "quotes",
              "bookmarks"
            ]
          }
        },
        "required": [
          "id",
          "url",
          "text",
          "published_at",
          "kind",
          "media_kind",
          "metrics"
        ]
      }
    },
    "coverage": {
      "type": "object",
      "properties": {
        "complete": {
          "type": "boolean"
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2048
            },
            {
              "type": "null"
            }
          ]
        },
        "views_available_posts": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "omitted_rows": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "reasons": {
          "maxItems": 8,
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 300
          }
        }
      },
      "required": [
        "complete",
        "next_cursor",
        "views_available_posts",
        "omitted_rows",
        "reasons"
      ]
    }
  },
  "required": [
    "contract_version",
    "source",
    "source_kind",
    "platform",
    "workspace_id",
    "social_account_id",
    "provider_account_id",
    "fetched_at",
    "upstream_updated_at",
    "expires_at",
    "cache_status",
    "status",
    "profile",
    "posts",
    "coverage"
  ]
}

Erros e repetições seguras

Confira o status HTTP e o corpo da resposta. Um erro de validação 400 pode conter ZodError; erros do handler usam os campos error, message e code. Guarde request_id ou x-request-id para diagnóstico, sem credenciais. Corrija erros de acesso 401/403 antes de tentar novamente e siga Retry-After para 429. Se uma gravação for incerta ou retornar 5xx, consulte primeiro o resultado existente. Reutilize uma chave de idempotência somente quando houver suporte; o comportamento de repetição varia por operação e não garante entrega exatamente uma vez.

Guia de solução de problemas

Exemplos

Estes exemplos usam valores fictícios verificados conforme os schemas. Substitua os IDs por aqueles que você tem autorização para usar, a mídia por ativos prontos e as datas pelo horário de publicação confirmado. Confira a elegibilidade da conta antes de enviar uma gravação. Esta página não envia requisições de API.

Defina SOSOAPI_ACCESS_TOKEN no servidor como uma credencial aceita por esta operação e mantenha-a fora do código do navegador. Para agentes, use sosoapi auth login para entrar pelo navegador e deixe a CLI renovar suas credenciais.

request.json

{
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "social_account_id": "22222222-2222-4222-8222-222222222222"
}

cURL

curl --request POST \
  "https://gqeshlawtcexsapabaui.supabase.co/functions/v1/analytics-api/public-performance/read" \
  -H "Authorization: Bearer $SOSOAPI_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @request.json

JavaScript

// Server-side JavaScript. Do not print tokens or credential-bearing responses.
const token = process.env.SOSOAPI_ACCESS_TOKEN;
if (!token) throw new Error("Set an accepted credential for this operation");
const response = await fetch("https://gqeshlawtcexsapabaui.supabase.co/functions/v1/analytics-api/public-performance/read", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
  body: JSON.stringify({
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "social_account_id": "22222222-2222-4222-8222-222222222222"
})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.

CLI

npx sosoapi api post /analytics-api/public-performance/read < request.json

Exemplo de resposta sintética

{
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "social_account_id": "22222222-2222-4222-8222-222222222222",
  "contract_version": "public-performance/v1",
  "source": "fxtwitter",
  "source_kind": "unofficial_public",
  "platform": "x",
  "provider_account_id": "12345",
  "fetched_at": "2099-01-15T09:00:00Z",
  "upstream_updated_at": null,
  "expires_at": "2099-01-15T09:05:00Z",
  "cache_status": "stored",
  "status": "unavailable",
  "profile": null,
  "posts": [],
  "coverage": {
    "complete": false,
    "next_cursor": null,
    "views_available_posts": 0,
    "omitted_rows": 0,
    "reasons": [
      "Fictional public source unavailable; no account data was read."
    ]
  }
}

MCP: sosoapi_read_public_performance