nsindocs Search the docs⌘K
  1. Docs
  2. API reference
  3. Analytics

Preview Markdown-for-Agents conversion

gethttps://api.nsin.ir/analytics/markdown-tester

Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.

Fetches one page twice — once normally and once with Accept: text/markdown — and returns both responses so you can compare them. Ownership is checked but there is no plan gate: you may preview the conversion before enabling markdown_for_agents on the domain.

Query parameters

  • domainstringrequiredquery

    The domain name (for example example.com). These endpoints take the domain as a query parameter rather than a path segment.

  • hostnamestringquery

    Which hostname to fetch. Defaults to the domain apex.

  • pathstringquery

    Path to fetch.

    Default: "/"

Responses

200Both fetches, side by side.

Content type: application/json

  • urlstring

    The URL that was fetched.

  • feature_enabledboolean

    The domain's markdown_for_agents setting at test time.

  • htmlMarkdownTesterFetch
    Fields
    • statusinteger
    • content_typestring
    • content_lengthinteger

      Full body length observed, before truncation.

    • bodystring
    • truncatedboolean
    • binaryboolean

      The body was not valid UTF-8, so body is omitted.

    • cache_statusstring
    • markdown_tokensinteger
    • original_tokensinteger
    • convertedboolean

      The response came back as text/markdown.

    • errorstring
  • markdownMarkdownTesterFetch
    Fields
    • statusinteger
    • content_typestring
    • content_lengthinteger

      Full body length observed, before truncation.

    • bodystring
    • truncatedboolean
    • binaryboolean

      The body was not valid UTF-8, so body is omitted.

    • cache_statusstring
    • markdown_tokensinteger
    • original_tokensinteger
    • convertedboolean

      The response came back as text/markdown.

    • errorstring
json
{
  "url": "string",
  "feature_enabled": true,
  "html": {
    "status": 0,
    "content_type": "string",
    "content_length": 0,
    "body": "string",
    "truncated": true,
    "binary": true,
    "cache_status": "string",
    "markdown_tokens": 0,
    "original_tokens": 0,
    "converted": true,
    "error": "string"
  },
  "markdown": {
    "status": 0,
    "content_type": "string",
    "content_length": 0,
    "body": "string",
    "truncated": true,
    "binary": true,
    "cache_status": "string",
    "markdown_tokens": 0,
    "original_tokens": 0,
    "converted": true,
    "error": "string"
  }
}
400Missing domain, or an invalid hostname or path.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}
401Missing, malformed, revoked or expired API key. (A valid key whose account has been deactivated gets 403 account is inactive instead.)

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "invalid API key"
}
404No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}
429The key exceeded its request budget (300 requests per minute by default).

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "rate limit exceeded"
}

Example request

bash
curl -X GET "https://api.nsin.ir/analytics/markdown-tester?domain=example.com" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc