Preview Markdown-for-Agents conversion
const url = 'https://api.nsin.ir/analytics/markdown-tester?domain=example.com&path=%2F';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.nsin.ir/analytics/markdown-tester?domain=example.com&path=%2F' \ --header 'Authorization: Bearer <token>'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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”The domain name (for example example.com). These endpoints take the
domain as a query parameter rather than a path segment.
Example
example.comWhich hostname to fetch. Defaults to the domain apex.
Path to fetch.
Responses
Section titled “ Responses ”Both fetches, side by side.
object
The URL that was fetched.
The domain’s markdown_for_agents setting at test time.
object
Full body length observed, before truncation.
The body was not valid UTF-8, so body is omitted.
The response came back as text/markdown.
object
Full body length observed, before truncation.
The body was not valid UTF-8, so body is omitted.
The response came back as text/markdown.
Example generated
{ "url": "example", "feature_enabled": true, "html": { "status": 1, "content_type": "example", "content_length": 1, "body": "example", "truncated": true, "binary": true, "cache_status": "example", "markdown_tokens": 1, "original_tokens": 1, "converted": true, "error": "example" }, "markdown": { "status": 1, "content_type": "example", "content_length": 1, "body": "example", "truncated": true, "binary": true, "cache_status": "example", "markdown_tokens": 1, "original_tokens": 1, "converted": true, "error": "example" }}Missing domain, or an invalid hostname or path.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}Missing, malformed, revoked or expired API key — or the owning account is inactive.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}The key exceeded its request budget (300 requests per minute by default).
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "rate limit exceeded"}