GetMarkdown
← GetMarkdown converter

API & MCP

Developers

Convert web pages and PDFs to Markdown from your code or your agent.

View as Markdown

Quick start

Convert a public web page to Markdown. No API key needed.

bash
curl 'https://www.getmarkdown.com/api/v1/extract?url=https://example.com' \
  -H 'Accept: text/markdown'

URL to Markdown

Extract the main content of a public HTTP(S) page. JSON includes Markdown, metadata, and usage.

Request
curl https://www.getmarkdown.com/api/v1/extract \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://example.com"}'
Response
{
  "url": "https://example.com/",
  "markdown": "---\ntitle: Example Domain\nsource: https://example.com/\n---\n\n# Example Domain\n",
  "title": "Example Domain",
  "author": null,
  "site": null,
  "published": null,
  "description": null,
  "wordCount": 2,
  "cached": false,
  "usage": {
    "freeRemaining": 19,
    "creditsRemaining": null,
    "charged": 0
  }
}

Parameters

FieldTypeDescription
urlstring, requiredPublic HTTP(S) URL. Use a GET query parameter or a POST JSON body.
methodauto | browser, optionalDefaults to auto. Use browser to retry incomplete content with JavaScript rendering when available.
formatstring, optionalQuery parameter: markdown returns raw Markdown instead of JSON.
Acceptheader, optionaltext/markdown returns raw Markdown; application/json is the default.
Authorizationheader, optionalBearer API key or signed-in session token.

Response fields

FieldTypeDescription
urlstringFinal address after redirects.
markdownstringMain content with YAML frontmatter.
title, author, sitestring | nullSource metadata, when provided by the page.
published, descriptionstring | nullPublication date and description, when available.
wordCountintegerWords in the extracted content.
methodstring, optionalConversion path: defuddle, native or browser.
tokenCountinteger, optionalApproximate output tokens; not a model-specific tokenizer count.
cachedbooleanWhether this result came from the cache.
usage.freeRemaininginteger | nullFree pages left today; null for API keys.
usage.creditsRemaininginteger | nullBalance after this request; null for anonymous callers.
usage.chargedintegerCredits spent on this request.

Response headers

HeaderDescription
X-RateLimit-LimitDaily free allowance; omitted for API keys.
X-RateLimit-RemainingFree pages left today; omitted for API keys.
X-Credits-RemainingBalance after the request; omitted for anonymous callers.
X-Credits-ChargedCredits spent on a successful extraction, including zero.
Retry-AfterOn rate limits, seconds to wait before retrying.

20 pages per UTC day are free per IP, or per signed-in user; then signed-in users pay 1 credit per uncached page.

API keys pay 1 credit from the first uncached page. Cached results are free for signed-in users and API keys.

Content is cached for up to an hour. Anonymous cache hits count toward the daily allowance; failed or empty extractions spend no credits.

Auto accepts Markdown from the source or extracts HTML with Defuddle. When browser rendering is configured, empty pages are rendered automatically. Retry incomplete results with method:"browser". External scripts/APIs, logins, and bot protection may still prevent conversion.

Website to Markdown

Convert a public website section to a combined Markdown document or ZIP. Requires website conversion to be enabled and an authenticated account or API key. A crawl stays within the selected website section; logins, paywalls and bot challenges are not bypassed.

Start a crawl
curl https://www.getmarkdown.com/api/v1/crawls \
  -H 'Authorization: Bearer gmk_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: YOUR_UNIQUE_REQUEST_KEY' \
  -d '{"url":"https://example.com/docs/","limit":10,"depth":2,"render":false}'

The page limit defaults to 10 and may be 1 to 50. Depth defaults to 2 and may be 0 to 5. Enable render for pages that load through JavaScript. Starting reserves the maximum credit cost: 1 credit per requested page. The final cost is 1 credit per successful page; unused credits are refunded when the crawl settles. Reuse the same Idempotency-Key and identical arguments when retrying a start request.

Poll, cancel, and download
curl https://www.getmarkdown.com/api/v1/crawls/CRAWL_ID \
  -H 'Authorization: Bearer gmk_YOUR_API_KEY'

curl -X DELETE https://www.getmarkdown.com/api/v1/crawls/CRAWL_ID \
  -H 'Authorization: Bearer gmk_YOUR_API_KEY'

curl 'https://www.getmarkdown.com/api/v1/crawls/CRAWL_ID/download?format=zip' \
  -H 'Authorization: Bearer gmk_YOUR_API_KEY' -o website.zip

Responses wrap {crawl,balance}. Crawl status includes per-page outcomes, reservedCredits, chargedCredits, refundedCredits and settled. Poll until settled after cancellation. GET /api/v1/crawls lists the newest 20 jobs for the account. Download requires the same session or API key; use format=markdown for one document or format=zip for individual files. Outputs expire after 48 hours. New starts may return 503 when unavailable; existing owned jobs remain accessible.

When enabled, the MCP tools are crawl_website, get_website_crawl and cancel_website_crawl. Starting requires confirmCharge:true after approval of the maximum cost; use the optional idempotencyKey for safe retries. Poll tools return authenticated download paths without exposing keys in URLs.

API keys

Create a key on your account page, even with a zero balance. Send it in the Authorization header.

http
Authorization: Bearer gmk_YOUR_API_KEY

Limits

LimitValue
Requests per minute, active Pro plan120
Requests per minute, all other accounts and accountless keys60
Active API keys per account10

Request limits are shared per account, including polls and uploads. Keep keys out of URLs and tool arguments.

Keys can spend your balance and access all account jobs, including browser-created jobs. Revoke unused keys on your account page.

Agent keys without an account

An agent creates a purchase link, a person pays, and the agent claims its key. No account needed.

  1. 1.Create a purchase

    Request 500 pay-as-you-go credits. The response returns checkoutUrl, sessionToken, pollUrl, and expiresAt.

    bash
    curl https://www.getmarkdown.com/api/v1/agent-keys \
      -H 'Content-Type: application/json' \
      -d '{"pack":"pack_500"}'
  2. 2.Pay and claim the key

    Have a person open checkoutUrl and pay. Keep sessionToken and pollUrl private; poll until payment is confirmed.

    bash
    curl https://www.getmarkdown.com/api/v1/agent-keys/sessions/YOUR_SESSION_TOKEN
  3. 3.Save the key and check usage

    Save the first paid response securely: it contains key and credits. The key is shown only once.

    bash
    curl https://www.getmarkdown.com/api/v1/usage \
      -H 'Authorization: Bearer gmk_YOUR_API_KEY'
  4. 4.Top up the same balance

    Pay the new checkoutUrl, then poll its pollUrl. A paid top-up returns status and credits without another key.

    bash
    curl https://www.getmarkdown.com/api/v1/agent-keys/topup \
      -H 'Authorization: Bearer gmk_YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -d '{"pack":"pack_500"}'

Pay as you go

PackPriceCreditsValidity
pack_500$1250012 months

Polling returns HTTP 202 with status pending until the verified payment webhook grants credits, then HTTP 200 with status paid.

Unpaid links expire after 60 minutes. Paid purchases remain claimable after link expiry.

At most 5 unpaid purchase sessions per IP per hour are allowed. Subscriptions and linking to signed-in accounts are unavailable.

Only key and session token hashes are stored. A lost claim response cannot be replayed to recover the key.

Check usage

Read your balance and recent spend with an API key or signed-in session. This call spends no credits or free pages.

bash
curl https://www.getmarkdown.com/api/v1/usage \
  -H 'Authorization: Bearer gmk_YOUR_API_KEY'

Response fields

FieldTypeDescription
balanceintegerAvailable credits, including refunds.
lotsarrayActive credit lots in expiry order: source, remaining, expiresAt, and grantedAt.
planstring | nullCurrent plan lookup key, or null.
rateLimitPerMinuteintegerShared account request limit; usage checks count toward it.
freeUrlExtractsobjectSession allowance: limit, remaining, resetsAt (UTC); API keys pay from the first uncached URL.
recentSpendarrayLast 20 negative ledger debits; a charge split across lots has multiple rows.
recentSpend[].apiKeyIdstring | nullKey that made the spend; historical rows may have no key attribution.
keyobject, optionalCurrent API key only: id, name, prefix, createdAt, lastUsedAt, and creditsSpent.
key.creditsSpentintegerGross all-time spend before refunds, since key tracking began.

Authenticated extraction, usage, conversion creation, and job start responses include X-Credits-Remaining. Never cache usage responses.

PDF conversion API

Upload a PDF, review its quote, then approve the credit charge. Use the same API key throughout.

  1. 1.Create a job

    Set byteSize to the exact file size. Save job.id and uploadUrl from the response; creation spends no credits.

    bash
    curl https://www.getmarkdown.com/api/v1/convert \
      -H 'Authorization: Bearer gmk_YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -d '{"fileName":"report.pdf","byteSize":12345,"includeImages":false}'
  2. 2.Upload the PDF

    PUT raw bytes directly to the returned uploadUrl. Content-Length must match byteSize; curl sets it for a file.

    bash
    curl -X PUT 'UPLOAD_URL_FROM_RESPONSE' \
      -H 'Authorization: Bearer gmk_YOUR_API_KEY' \
      -H 'Content-Type: application/pdf' \
      --data-binary @report.pdf
  3. 3.Read the quote

    Poll until job.status is quoted or failed. Read job.quote.costCredits before approving the charge.

    bash
    curl https://www.getmarkdown.com/api/v1/jobs/JOB_ID \
      -H 'Authorization: Bearer gmk_YOUR_API_KEY'
  4. 4.Start conversion

    After approval, spend the quoted credits. Repeating start on the same job does not charge again.

    bash
    curl -X POST https://www.getmarkdown.com/api/v1/jobs/JOB_ID/start \
      -H 'Authorization: Bearer gmk_YOUR_API_KEY'
  5. 5.Wait for the result

    Poll until ready or failed, staying below your request limit. Failed conversions refund reserved credits automatically.

    bash
    curl https://www.getmarkdown.com/api/v1/jobs/JOB_ID \
      -H 'Authorization: Bearer gmk_YOUR_API_KEY'
  6. 6.Download the ZIP

    The ZIP contains Markdown and JSON, plus images when requested. Save the job ID to resume after interruption.

    bash
    curl https://www.getmarkdown.com/api/v1/jobs/JOB_ID/download \
      -H 'Authorization: Bearer gmk_YOUR_API_KEY' \
      -o report.zip

Limits

LimitValue
File size25 MB
Document length500 pages
Pending developer jobs5
Output retention after completion48 hours
Unstarted jobs eligible for hourly cleanupAfter 2 hours
Text page1 credit
Scanned page (OCR)2 credits

Cancel an unstarted, uncharged job to release its pending slot. Repeating cancellation succeeds; started or charged jobs cannot be cancelled.

Cancel a job
curl -X DELETE https://www.getmarkdown.com/api/v1/jobs/JOB_ID \
  -H 'Authorization: Bearer gmk_YOUR_API_KEY'

MCP

Connect a Streamable HTTP client to this endpoint. Set the Authorization header for paid tools and credit-funded URLs.

Endpoint
https://www.getmarkdown.com/api/mcp
Client configuration
{
  "mcpServers": {
    "getmarkdown": {
      "url": "https://www.getmarkdown.com/api/mcp",
      "headers": {
        "Authorization": "Bearer gmk_YOUR_API_KEY"
      }
    }
  }
}

Tools

NameWhat it doesNeeds a key
convert_urlExtract a public page as Markdown with URL, title, word count, cache, and usage metadata.No
get_agent_guidanceRead workflow and product guidance.No
list_supported_formatsList browser converter formats and limits.No
recommend_workflowChoose the browser converter or Pro for a file.No
get_developer_resourcesList documented agent endpoints.No
convert_documentUpload base64 PDF bytes for a quote, up to 1 MB decoded.Yes
get_document_conversionRead a quote, job status, or downloadPath.Yes
start_document_conversionStart after user approval, with jobId and confirmCharge: true.Yes
cancel_document_conversionDiscard an unstarted job without spending credits.Yes

convert_url is always listed and shares the anonymous allowance. Only API keys are forwarded from the MCP Authorization header.

PDF tools are listed when developer access is enabled. Use the direct API for larger PDFs; download the returned ZIP path with your key.

MCP uses JSON-RPC: initialize, tools/list, and tools/call. Tool failures return isError: true with a message and recovery hint.

Errors

HTTP errors return JSON with error.code, error.message, and an optional error.hint. Read the hint before retrying.

HTTP errors

HTTPCodeMeaningWhat to do
400invalid_urlMissing or invalid URL.Send a public HTTP(S) URL.
400blocked_urlPrivate or disallowed destination.Use a public address.
400invalid_packUnsupported credit pack.Use pack_500.
400invalid_file_nameFilename is not a PDF.Use a filename ending in .pdf.
400invalid_byte_sizeFile size is invalid.Send the exact positive byte count.
400invalid_include_imagesImage option is invalid.Send true or false.
400empty_uploadUpload has no body.Send raw PDF bytes.
400not_pdfUpload is not a PDF.Upload PDF bytes.
400length_mismatchUpload length differs from byteSize.Use the exact file size.
401unauthorizedAuthentication is missing, invalid, or revoked.Send a valid Bearer token.
402insufficient_creditsBalance is too low.Top up, then retry the same request or job.
404not_foundUnknown API route.Check the OpenAPI specification.
404job_not_foundJob missing or owned by another account.Check the job ID and key.
405method_not_allowedHTTP method is unsupported.Use the documented method.
409invalid_statusJob is in the wrong state.Read its status before retrying.
410output_expiredDownload has expired.Convert the PDF again.
410session_expiredPolling token is unknown or unpaid checkout expired.Create a new purchase; read the recovery hint.
410session_cancelledPurchase was cancelled.Create a new purchase.
410key_already_claimedKey has already been shown.Use the saved key; it cannot be recovered by polling.
411length_requiredUpload Content-Length is missing.Send the exact byte length.
413file_too_largePDF exceeds the upload limit.Split or reduce the PDF.
413page_too_largeThe page exceeds the size limit or is too complex for server-side HTML extraction.Save the page as HTML and use the browser converter.
422no_contentNo readable page content.Save JavaScript-only pages as HTML and upload the file.
422unsupported_contentResponse is not HTML.Use a public HTML page.
422page_is_pdfURL points to a PDF.Download it and use a PDF converter.
429free_limit_reachedAnonymous daily allowance is exhausted.Wait for Retry-After or buy an API key.
429rate_limitedAccount request limit is exhausted.Wait for Retry-After; slow down polling.
429pending_job_limitToo many pending developer jobs.Finish or cancel an unstarted job.
429agent_checkout_limitToo many unpaid purchase sessions.Wait for Retry-After before creating another.
502fetch_failedSource fetch failed or was blocked.Check the source or save its HTML manually.
502checkout_unavailableCheckout link could not be created.Retry the purchase later.
503developer_api_unavailableAPI keys return 503 while the developer API is disabled.Use anonymous URL extraction or try again later.
503checkout_disabledPurchases are paused.Try again later.
503price_unavailableCredit pack is unavailable.Try another pack or retry later.
503queue_unavailableInspection or conversion could not start.Retry later; a failed start refunds credits.
504fetch_timeoutSource did not respond in time.Retry later or save its HTML manually.

insufficient_credits and free_limit_reached include a purchase object: createKey, topUp, packs, and docs. convert_url includes it in error text.

JSON-RPC errors

CodeMeaningWhat to do
-32700Invalid JSON.Send a valid JSON body.
-32600Invalid request.Use a JSON-RPC request with a method.
-32601Unknown method.Use initialize, tools/list, or tools/call.
-32602Unknown tool or invalid arguments.Check tools/list and its input schemas.

Resources for agents

Content negotiation
curl -H 'Accept: text/markdown' https://www.getmarkdown.com/

The homepage Markdown response declares Vary: Accept, Accept-Encoding. Free file conversion runs locally in your browser.