Skip to content

Ask a PageFox site one grounded question

A cited answer, its schema.org form, and an AI disclosure, over plain HTTP.

GET · no key, no origin check · site owner opt-in · Growth and above

GET /api/sites/{websiteId}/ask?q=Which plan includes API access?

No API key · answers from indexed site content only

[ 01 / 08 ] · Endpoint

What this endpoint is.

/api/sites/{websiteId}/ask answers a single question about one website using only the content that website has indexed in PageFox. It is stateless: no conversation, no history, no visitor record. It exists so an agent, a crawler, or an AI search assistant running anywhere can query a site directly, which is why it takes no API key and performs no origin check.

It answers from indexed site content only. When retrieval finds nothing usable the endpoint returns an honest "this is not covered" answer rather than inventing one, and it never reads private workspace data such as leads, companies, or conversations. For those, use the REST API.

[ 02 / 08 ] · Request

The request. One GET, one query parameter.

websiteId is the website's UUID. Find it in Settings → Widget, under “Agent access”: switching the surface on shows the two live URLs for that website with the id already in them, so there is nothing to assemble. Owners on a plan that includes API access can also read it from GET /api/v1/websites.

ParameterRequiredRules
qYesTrimmed, then 1-500 characters. Whitespace-only or over the limit returns 400.
Terminal
curl --fail-with-body \
  --get \
  --data-urlencode "q=Which plan includes API access?" \
  "https://pagefox.co/api/sites/00000000-0000-4000-8000-000000000000/ask"
[ 03 / 08 ] · Response

The response, in every shape.

An answer body has four fields. answer is prose. sources lists up to 4 cited pages as { url, title }. schema_org is the same answer as a schema.org Question you can embed directly. disclosure states that the answer came from an AI assistant.

The X-PageFox-Answer-Mode header distinguishes a real answer (grounded) from the honest fallback (no_context_fallback). Both are 200 with an empty or populated sources array, so branch on the header rather than on the status code. Responses are never cached, so a site owner turning the feature off takes effect immediately.

200 response
{
  "answer": "The Business plan includes read-only REST API access.",
  "sources": [
    {
      "url": "https://example.com/pricing",
      "title": "Pricing"
    },
    {
      "url": "https://example.com/docs/api",
      "title": "Api"
    }
  ],
  "schema_org": {
    "@context": "https://schema.org",
    "@type": "Question",
    "name": "Which plan includes API access?",
    "url": "https://example.com",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "The Business plan includes read-only REST API access.",
      "url": "https://example.com"
    },
    "citation": [
      {
        "@type": "WebPage",
        "url": "https://example.com/pricing",
        "name": "Pricing"
      },
      {
        "@type": "WebPage",
        "url": "https://example.com/docs/api",
        "name": "Api"
      }
    ]
  },
  "disclosure": "You are interacting with an AI assistant."
}

Error bodies are a different shape

Do not assume answer exists. A 400, 404 or 429 returns an error envelope: an error string plus disclosure, and nothing else. Check the status code first, and only then read answer.

404 response
{
  "error": "Not found",
  "disclosure": "You are interacting with an AI assistant."
}

The 503 has two forms, so branch on the presence of answer rather than on the status alone: when both models fail, you receive the four-field answer body carrying a safe unavailable message and an empty sources array; when the request fails before that point, you receive the error envelope with an extra message field.

The one guarantee that does hold across every shape: disclosure is present on every response this endpoint returns, success or error, because the route builds all of them through one constructor.

503 response: request failed before generation
{
  "error": "assistant_unavailable",
  "message": "This assistant is temporarily unavailable. Please try again in a moment.",
  "disclosure": "You are interacting with an AI assistant."
}
[ 04 / 08 ] · Gates

When a site will answer.

All of the following must hold, or the endpoint returns 404.

The site owner has switched Agent answers on for that website. It is off by default.

The organization is on Growth or above.

The website is not paused, and the organization is active.

Every one of those conditions, including a website ID that simply does not exist, returns the identical 404 body. That is deliberate: the endpoint is not an oracle for which sites use PageFox or which plan they are on.

[ 05 / 08 ] · Rate limits

Rate limits.

500 requests per website per day. This is the site's whole budget across all callers, and it resets daily in UTC.

20 requests per minute per IP, so one caller cannot spend a site's day alone.

Exhausting either returns 429 with a Retry-After header. These budgets are separate from the site's chat conversation limits and from the REST API budget.

[ 06 / 08 ] · Status codes

Status codes.

200
A grounded answer, or an honest "no indexed content covers this" fallback. Both carry `disclosure`; check the answer-mode header to tell them apart.
400
Error envelope. `q` is missing, empty after trimming, or longer than 500 characters.
404
Error envelope. The website does not exist, is paused, has agent answers switched off, is on a plan without the entitlement, or its organization is disabled. All five look identical on purpose.
429
Error envelope. A rate-limit bucket is exhausted. Wait for `Retry-After`.
503
Two shapes. Both models failing returns the four-field answer body with a safe unavailable message and no sources; a failure before generation returns the error envelope plus a `message` field. Retry later; nothing was fabricated either way.
[ 07 / 08 ] · llms.txt

The companion file.

A site with agent answers enabled also serves /api/sites/{websiteId}/llms.txt, generated live from that site's indexed pages under the same opt-in and plan gate. Use it to discover what a site can answer about before you ask.

[ 08 / 08 ] · Not yet

What is not available yet.

There is no POST form, no streaming, no multi-turn context, no per-question caching, and no way to reach private workspace data through this endpoint. PageFox does not currently publish an SDK, an MCP server, or a general agent connection.

Your next lead may already be on your site.