API para ChatGPT

API para ChatGPT: Buscar

Faça ao ChatGPT uma pergunta embasada na web e receba uma resposta com citações das fontes. O ChatGPT compõe cada resposta por requisição, então o mesmo prompt retorna palavras diferentes e um conjunto diferente de fontes.

POST/v1/run/chatgpt.search
Disponibilidade
97,39%
30d · 613 chamadas
Requisições
614
30d · semanal, últimas 12 sem.
Resposta
32,6s
mediana · 30d

Teste

Faça sua primeira requisição

requireFieldsarray
Opcional; se omitido, o roteamento não muda e a fonte mais barata atende. Informe os campos de saída que esta requisição precisa poder retornar, por exemplo `cited` ou `ads`, e ela só será atendida por uma fonte que retorne todos eles. Os campos que você não informar continuam sendo retornados sempre que a fonte que atende os tiver. Isso pode aumentar o seu preço: quando a fonte mais barata não consegue retornar um campo informado, uma fonte mais cara atende, e você recebe a cotação e é cobrado pelo preço dela. Um campo informado ainda pode vir ausente em um resultado que realmente não o tenha. Se você informar uma combinação de campos que nenhuma fonte retorna sozinha, a requisição é recusada como entrada inválida, sem cobrança.
Abrir em
Obter chave grátis
Resposta de exemplo
Execuções grátis retornam só os primeiros 3 resultados. Recarregue uma chave para receber a resposta completa.
{
  "data": {
    "ads": [
      {
        "advertiserName": "Example title",
        "advertiserUrl": "https://example.com/page",
        "domain": "example.com",
        "image": "https://example.com/image.jpg",
        "snippet": "A short example description of this item.",
        "title": "Example title",
        "url": "https://example.com/page"
      }
    ],
    "answer": "example",
    "answerMarkdown": "example",
    "citations": [
      {
        "answerPosition": 1,
        "title": "Example title",
        "url": "https://example.com/page"
      }
    ],
    "createdUtc": 12.5,
    "entities": [
      {
        "category": "general",
        "domain": "example.com",
        "title": "Example title",
        "url": "https://example.com/page"
      }
    ],
    "model": "example",
    "places": [
      {
        "address": "123 Main St",
        "category": "general",
        "description": "A short example description of this item.",
        "name": "Example title",
        "phone": "+1 555-0142",
        "position": 1,
        "rating": 4.6,
        "reviewCount": 12500,
        "websiteUrl": "https://example.com/page"
      }
    ],
    "prompt": "example",
    "searchQueries": [
      "example"
    ],
    "searchResults": [
      {
        "cited": true,
        "title": "Example title",
        "url": "https://example.com/page"
      }
    ],
    "shoppingCards": [
      {
        "currency": "USD",
        "description": "A short example description of this item.",
        "image": "https://example.com/image.jpg",
        "merchants": "example",
        "price": 19.99,
        "rating": 4.6,
        "title": "Example title",
        "url": "https://example.com/page"
      }
    ],
    "webSearchTriggered": true
  },
  "found": true,
  "reason": "not_found"
}
Interface da resposta
interface ChatgptSearchResponse {
  data: {
    ads?: {
      advertiserName?: string | null;
      advertiserUrl?: string | null;
      domain?: string | null;
      image?: string | null;
      snippet?: string | null;
      title: string;
      url?: string | null;
    }[] | null;
    answer: string;
    answerMarkdown: string;
    citations: {
      answerPosition?: number | null;
      title: string;
      url: string;
    }[];
    createdUtc?: number | null;
    entities?: {
      category?: string | null;
      domain?: string | null;
      title: string;
      url?: string | null;
    }[] | null;
    model?: string | null;
    places?: {
      address?: string | null;
      category?: string | null;
      description?: string | null;
      name: string;
      phone?: string | null;
      position?: number;
      rating?: number | null;
      reviewCount?: number | null;
      websiteUrl?: string | null;
    }[] | null;
    prompt: string;
    searchQueries?: string[] | null;
    searchResults?: {
      cited?: boolean;
      title?: string;
      url?: string;
    }[] | null;
    shoppingCards?: {
      currency?: string | null;
      description?: string | null;
      image?: string | null;
      merchants?: string | null;
      price?: number | null;
      rating?: number | null;
      title: string;
      url?: string | null;
    }[] | null;
    webSearchTriggered?: boolean | null;
  } | null;
  found: boolean;
  reason?: "not_found";
}

Referência completa de parâmetros e resposta - todos os campos, tipos e exemplos deste endpoint.

Referência

Requisição, resposta e preço

Última verificação em 2026-09-29 · disponibilidade e latência medidas em 30d
POST /v1/run/chatgpt.search
curl -X POST https://api.getanyapi.com/v1/run/chatgpt.search \
  -H "Authorization: Bearer $ANYAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"What is AnyAPI at getanyapi.com, and what does it offer?"}'
CampoTipoValor de exemplo
Corpo da requisição
promptstring"What is AnyAPI at getanyapi.com, and what does it offer?"Pergunta ou prompt de pesquisa para o ChatGPT responder usando busca na web.
countrystringPaís ISO-3166 alpha-2 de onde perguntar, ex.: US, GB, DE. O ChatGPT localiza tanto as páginas que busca quanto a resposta que escreve, então isso faz a diferença entre o que um comprador dos EUA e um do Reino Unido recebem como resposta.
requireAdsbooleanAtende apenas a partir de uma fonte que consegue retornar os posicionamentos patrocinados exibidos com a resposta. Hoje só uma fonte se qualifica, então a requisição não tem para onde recorrer quando ela está indisponível.
requireEntitiesbooleanAtende apenas a partir de uma fonte que consegue retornar marcas e outras entidades nomeadas reconhecidas na resposta. Hoje só uma fonte se qualifica, então a requisição não tem para onde recorrer quando ela está indisponível.
requireFieldsarrayOpcional; se omitido, o roteamento não muda e a fonte mais barata atende. Informe os campos de saída que esta requisição precisa poder retornar, por exemplo `cited` ou `ads`, e ela só será atendida por uma fonte que retorne todos eles. Os campos que você não informar continuam sendo retornados sempre que a fonte que atende os tiver. Isso pode aumentar o seu preço: quando a fonte mais barata não consegue retornar um campo informado, uma fonte mais cara atende, e você recebe a cotação e é cobrado pelo preço dela. Um campo informado ainda pode vir ausente em um resultado que realmente não o tenha. Se você informar uma combinação de campos que nenhuma fonte retorna sozinha, a requisição é recusada como entrada inválida, sem cobrança.
requirePlacesbooleanAtende apenas a partir de uma fonte que consegue retornar os locais exibidos com a resposta. Com isso desligado, os locais ainda são retornados sempre que a fonte que respondeu consegue. Ligado, é selecionada a única fonte que os garante, que custa mais e não tem para onde recorrer se estiver indisponível.
requireShoppingCardsbooleanAtende apenas a partir de uma fonte que consegue retornar os cards de compras exibidos com a resposta. Com isso desligado, os cards de compras ainda são retornados sempre que a fonte que respondeu consegue. Ligado, é selecionada a única fonte que os garante, que custa mais e não tem para onde recorrer se estiver indisponível.
webSearchenumSe deve obrigar o ChatGPT a navegar na web. force o instrui a buscar e é o padrão; auto deixa o ChatGPT decidir, o que é mais barato e responde de memória cerca de metade das vezes. Confira webSearchTriggered para saber o que realmente aconteceu: uma resposta escrita sem busca não é embasada na web.
Resposta
dataobjectThe normalized answer and citations, or null when no answer was found.
data.adspode ser exigidoobject[]Sponsored placements ChatGPT displayed with the answer. null means the source that answered cannot report ads; an empty array means none were shown.
data.ads[].advertiserNamepode ser exigidostringAdvertiser name.
data.ads[].advertiserUrlpode ser exigidostringAdvertiser URL, tracking parameters stripped.
data.ads[].domainpode ser exigidostringAdvertised domain.
data.ads[].imagestringSponsored image URL.
data.ads[].snippetpode ser exigidostringSponsored placement text.
data.ads[].titlestringSponsored placement title.
data.ads[].urlstringSponsored destination URL, tracking parameters stripped.
data.answerstringThe web-grounded answer as text. Populated whenever the provider has data for the entity.
data.answerMarkdownstringThe answer in Markdown when the engine returns a Markdown rendering, otherwise the same text as answer. Populated whenever the provider has data for the entity.
data.citationsobject[]Sources cited by the answer. Populated whenever the provider has data for the entity.
data.citations[].answerPositionpode ser exigidointegerOne-based answer section where ChatGPT cited this source. null means the source that answered cannot report the position.
data.citations[].titlestringSource page title when supplied by the search engine.
data.citations[].urlstringSource page URL.
data.createdUtcnumberUTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. null means the source that answered does not report when it answered.
data.entitiespode ser exigidoobject[]Brands and other named entities recognized in the answer. null means the source that answered cannot report them; an empty array means none were identified.
data.entities[].categorystringEntity category.
data.entities[].domainpode ser exigidostringEntity domain.
data.entities[].titlestringEntity name.
data.entities[].urlstringEntity URL, tracking parameters stripped.
data.modelpode ser exigidostringThe ChatGPT model that produced the answer. null means the source that answered does not report it, which is not the same as an unknown model.
data.placesobject[]Places and local businesses ChatGPT displayed with the answer. null means the source that answered cannot report them; an empty array means none were shown.
data.places[].addresspode ser exigidostringPlace address as displayed.
data.places[].categorystringPlace category shown by ChatGPT.
data.places[].descriptionpode ser exigidostringPlace description shown by ChatGPT.
data.places[].namestringPlace or business name.
data.places[].phonestringPlace phone number as displayed.
data.places[].positionintegerOne-based position in the places block.
data.places[].ratingnumberPlace rating when the source reports one.
data.places[].reviewCountintegerNumber of reviews behind the displayed rating.
data.places[].websiteUrlstringPlace website URL, tracking parameters stripped.
data.promptstringThe prompt answered by ChatGPT.
data.searchQueriespode ser exigidostring[]The web search queries ChatGPT ran to ground its answer. null means the source that answered cannot report them; an empty array means it searched with none recorded.
data.searchResultspode ser exigidoobject[]Pages ChatGPT retrieved while answering. A SUPERSET of citations: a page can be read and not cited. null means the source that answered cannot report them.
data.searchResults[].citedpode ser exigidobooleanWhether this retrieved page made it into citations. false means ChatGPT read the page and chose not to cite it, which is a different and more actionable fact than the page being absent.
data.searchResults[].titlestringTitle of the retrieved page, empty when the source did not send one.
data.searchResults[].urlstringCanonical URL of the retrieved page, tracking parameters stripped.
data.shoppingCardsobject[]Products ChatGPT displayed with the answer. null means the source that answered cannot report shopping cards; an empty array means none were shown.
data.shoppingCards[].currencypode ser exigidostringISO 4217 currency code when the source reports it.
data.shoppingCards[].descriptionpode ser exigidostringProduct description shown on the shopping card.
data.shoppingCards[].imagestringProduct image URL.
data.shoppingCards[].merchantsstringMerchant name shown on the shopping card.
data.shoppingCards[].pricenumberDisplayed product price as a number when the source reports one.
data.shoppingCards[].ratingnumberProduct rating when the source reports one.
data.shoppingCards[].titlestringProduct name shown by ChatGPT.
data.shoppingCards[].urlstringProduct page URL, tracking parameters stripped.
data.webSearchTriggeredpode ser exigidobooleanWhether ChatGPT actually ran a web search before answering. ChatGPT decides this per session, and an answer written without one is not web-grounded. null means the source that answered cannot report it, which is not the same as false.
foundbooleanWhether ChatGPT returned a web-grounded answer.
reason"not_found"Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost.
Preço
Preço por requisiçãoUSDUS$ 0,0018
Preço /mil req.USDUS$ 1,80

Dúvidas frequentes

Sobre o endpoint Buscar da API para ChatGPT

O endpoint Buscar da AnyAPI para ChatGPT retorna dados de ChatGPT em JSON normalizado com uma chamada POST para /v1/run/chatgpt.search. Faça ao ChatGPT uma pergunta embasada na web e receba uma resposta com citações das fontes. O ChatGPT compõe cada resposta por requisição, então o mesmo prompt retorna palavras diferentes e um conjunto diferente de fontes. A AnyAPI distribui cada requisição entre 2 fontes, com failover automático quando uma falha. Custa a partir de US$ 1,80 por mil requisições, em dólares, sem assinatura e sem mínimo mensal. Nos últimos 30 dias, 97,4% das chamadas ao endpoint Buscar da API para ChatGPT feitas pela AnyAPI tiveram sucesso, com tempo de resposta mediano de 32,6 segundos, em 613 chamadas medidas.

Custa a partir de US$ 1,80 por mil requisições, em dólares, sem assinatura e sem mínimo mensal. Você recarrega uma carteira em dólares e cada chamada desconta dela. Algumas requisições pagas pela carteira que falham geram cobranças de processamento, que repassamos pelo custo, sem margem; a resposta de erro mostra o valor cobrado.

Faça ao ChatGPT uma pergunta embasada na web e receba uma resposta com citações das fontes. O ChatGPT compõe cada resposta por requisição, então o mesmo prompt retorna palavras diferentes e um conjunto diferente de fontes. A resposta é JSON normalizado, com o mesmo envelope que todo endpoint da AnyAPI retorna, então processar um segundo endpoint é só trocar a URL, e nada mais.

Nos últimos 30 dias, 97,4% das chamadas ao endpoint Buscar da API para ChatGPT feitas pela AnyAPI tiveram sucesso, com tempo de resposta mediano de 32,6 segundos, em 613 chamadas medidas. Estas são medições da própria AnyAPI sobre o tráfego que passa pelo gateway, recalculadas continuamente, e não uma meta de nível de serviço publicada.