Quick start
Convert a public web page to Markdown. No API key needed.
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.
curl https://www.getmarkdown.com/api/v1/extract \
-H 'Content-Type: application/json' \
-d '{"url":"https://example.com"}'{
"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
| Field | Type | Description |
|---|---|---|
| url | string, required | Public HTTP(S) URL. Use a GET query parameter or a POST JSON body. |
| method | auto | browser, optional | Defaults to auto. Use browser to retry incomplete content with JavaScript rendering when available. |
| format | string, optional | Query parameter: markdown returns raw Markdown instead of JSON. |
| Accept | header, optional | text/markdown returns raw Markdown; application/json is the default. |
| Authorization | header, optional | Bearer API key or signed-in session token. |
Response fields
| Field | Type | Description |
|---|---|---|
| url | string | Final address after redirects. |
| markdown | string | Main content with YAML frontmatter. |
| title, author, site | string | null | Source metadata, when provided by the page. |
| published, description | string | null | Publication date and description, when available. |
| wordCount | integer | Words in the extracted content. |
| method | string, optional | Conversion path: defuddle, native or browser. |
| tokenCount | integer, optional | Approximate output tokens; not a model-specific tokenizer count. |
| cached | boolean | Whether this result came from the cache. |
| usage.freeRemaining | integer | null | Free pages left today; null for API keys. |
| usage.creditsRemaining | integer | null | Balance after this request; null for anonymous callers. |
| usage.charged | integer | Credits spent on this request. |
Response headers
| Header | Description |
|---|---|
| X-RateLimit-Limit | Daily free allowance; omitted for API keys. |
| X-RateLimit-Remaining | Free pages left today; omitted for API keys. |
| X-Credits-Remaining | Balance after the request; omitted for anonymous callers. |
| X-Credits-Charged | Credits spent on a successful extraction, including zero. |
| Retry-After | On 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.
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.
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.zipResponses 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.
Authorization: Bearer gmk_YOUR_API_KEYLimits
| Limit | Value |
|---|---|
| Requests per minute, active Pro plan | 120 |
| Requests per minute, all other accounts and accountless keys | 60 |
| Active API keys per account | 10 |
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.Create a purchase
Request 500 pay-as-you-go credits. The response returns checkoutUrl, sessionToken, pollUrl, and expiresAt.
bashcurl https://www.getmarkdown.com/api/v1/agent-keys \ -H 'Content-Type: application/json' \ -d '{"pack":"pack_500"}'2.Pay and claim the key
Have a person open checkoutUrl and pay. Keep sessionToken and pollUrl private; poll until payment is confirmed.
bashcurl https://www.getmarkdown.com/api/v1/agent-keys/sessions/YOUR_SESSION_TOKEN3.Save the key and check usage
Save the first paid response securely: it contains key and credits. The key is shown only once.
bashcurl https://www.getmarkdown.com/api/v1/usage \ -H 'Authorization: Bearer gmk_YOUR_API_KEY'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.
bashcurl 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
| Pack | Price | Credits | Validity |
|---|---|---|---|
| pack_500 | $12 | 500 | 12 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.
curl https://www.getmarkdown.com/api/v1/usage \
-H 'Authorization: Bearer gmk_YOUR_API_KEY'Response fields
| Field | Type | Description |
|---|---|---|
| balance | integer | Available credits, including refunds. |
| lots | array | Active credit lots in expiry order: source, remaining, expiresAt, and grantedAt. |
| plan | string | null | Current plan lookup key, or null. |
| rateLimitPerMinute | integer | Shared account request limit; usage checks count toward it. |
| freeUrlExtracts | object | Session allowance: limit, remaining, resetsAt (UTC); API keys pay from the first uncached URL. |
| recentSpend | array | Last 20 negative ledger debits; a charge split across lots has multiple rows. |
| recentSpend[].apiKeyId | string | null | Key that made the spend; historical rows may have no key attribution. |
| key | object, optional | Current API key only: id, name, prefix, createdAt, lastUsedAt, and creditsSpent. |
| key.creditsSpent | integer | Gross 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.Create a job
Set byteSize to the exact file size. Save job.id and uploadUrl from the response; creation spends no credits.
bashcurl 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.Upload the PDF
PUT raw bytes directly to the returned uploadUrl. Content-Length must match byteSize; curl sets it for a file.
bashcurl -X PUT 'UPLOAD_URL_FROM_RESPONSE' \ -H 'Authorization: Bearer gmk_YOUR_API_KEY' \ -H 'Content-Type: application/pdf' \ --data-binary @report.pdf3.Read the quote
Poll until job.status is quoted or failed. Read job.quote.costCredits before approving the charge.
bashcurl https://www.getmarkdown.com/api/v1/jobs/JOB_ID \ -H 'Authorization: Bearer gmk_YOUR_API_KEY'4.Start conversion
After approval, spend the quoted credits. Repeating start on the same job does not charge again.
bashcurl -X POST https://www.getmarkdown.com/api/v1/jobs/JOB_ID/start \ -H 'Authorization: Bearer gmk_YOUR_API_KEY'5.Wait for the result
Poll until ready or failed, staying below your request limit. Failed conversions refund reserved credits automatically.
bashcurl https://www.getmarkdown.com/api/v1/jobs/JOB_ID \ -H 'Authorization: Bearer gmk_YOUR_API_KEY'6.Download the ZIP
The ZIP contains Markdown and JSON, plus images when requested. Save the job ID to resume after interruption.
bashcurl https://www.getmarkdown.com/api/v1/jobs/JOB_ID/download \ -H 'Authorization: Bearer gmk_YOUR_API_KEY' \ -o report.zip
Limits
| Limit | Value |
|---|---|
| File size | 25 MB |
| Document length | 500 pages |
| Pending developer jobs | 5 |
| Output retention after completion | 48 hours |
| Unstarted jobs eligible for hourly cleanup | After 2 hours |
| Text page | 1 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.
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.
https://www.getmarkdown.com/api/mcp{
"mcpServers": {
"getmarkdown": {
"url": "https://www.getmarkdown.com/api/mcp",
"headers": {
"Authorization": "Bearer gmk_YOUR_API_KEY"
}
}
}
}Tools
| Name | What it does | Needs a key |
|---|---|---|
| convert_url | Extract a public page as Markdown with URL, title, word count, cache, and usage metadata. | No |
| get_agent_guidance | Read workflow and product guidance. | No |
| list_supported_formats | List browser converter formats and limits. | No |
| recommend_workflow | Choose the browser converter or Pro for a file. | No |
| get_developer_resources | List documented agent endpoints. | No |
| convert_document | Upload base64 PDF bytes for a quote, up to 1 MB decoded. | Yes |
| get_document_conversion | Read a quote, job status, or downloadPath. | Yes |
| start_document_conversion | Start after user approval, with jobId and confirmCharge: true. | Yes |
| cancel_document_conversion | Discard 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
| HTTP | Code | Meaning | What to do |
|---|---|---|---|
| 400 | invalid_url | Missing or invalid URL. | Send a public HTTP(S) URL. |
| 400 | blocked_url | Private or disallowed destination. | Use a public address. |
| 400 | invalid_pack | Unsupported credit pack. | Use pack_500. |
| 400 | invalid_file_name | Filename is not a PDF. | Use a filename ending in .pdf. |
| 400 | invalid_byte_size | File size is invalid. | Send the exact positive byte count. |
| 400 | invalid_include_images | Image option is invalid. | Send true or false. |
| 400 | empty_upload | Upload has no body. | Send raw PDF bytes. |
| 400 | not_pdf | Upload is not a PDF. | Upload PDF bytes. |
| 400 | length_mismatch | Upload length differs from byteSize. | Use the exact file size. |
| 401 | unauthorized | Authentication is missing, invalid, or revoked. | Send a valid Bearer token. |
| 402 | insufficient_credits | Balance is too low. | Top up, then retry the same request or job. |
| 404 | not_found | Unknown API route. | Check the OpenAPI specification. |
| 404 | job_not_found | Job missing or owned by another account. | Check the job ID and key. |
| 405 | method_not_allowed | HTTP method is unsupported. | Use the documented method. |
| 409 | invalid_status | Job is in the wrong state. | Read its status before retrying. |
| 410 | output_expired | Download has expired. | Convert the PDF again. |
| 410 | session_expired | Polling token is unknown or unpaid checkout expired. | Create a new purchase; read the recovery hint. |
| 410 | session_cancelled | Purchase was cancelled. | Create a new purchase. |
| 410 | key_already_claimed | Key has already been shown. | Use the saved key; it cannot be recovered by polling. |
| 411 | length_required | Upload Content-Length is missing. | Send the exact byte length. |
| 413 | file_too_large | PDF exceeds the upload limit. | Split or reduce the PDF. |
| 413 | page_too_large | The page exceeds the size limit or is too complex for server-side HTML extraction. | Save the page as HTML and use the browser converter. |
| 422 | no_content | No readable page content. | Save JavaScript-only pages as HTML and upload the file. |
| 422 | unsupported_content | Response is not HTML. | Use a public HTML page. |
| 422 | page_is_pdf | URL points to a PDF. | Download it and use a PDF converter. |
| 429 | free_limit_reached | Anonymous daily allowance is exhausted. | Wait for Retry-After or buy an API key. |
| 429 | rate_limited | Account request limit is exhausted. | Wait for Retry-After; slow down polling. |
| 429 | pending_job_limit | Too many pending developer jobs. | Finish or cancel an unstarted job. |
| 429 | agent_checkout_limit | Too many unpaid purchase sessions. | Wait for Retry-After before creating another. |
| 502 | fetch_failed | Source fetch failed or was blocked. | Check the source or save its HTML manually. |
| 502 | checkout_unavailable | Checkout link could not be created. | Retry the purchase later. |
| 503 | developer_api_unavailable | API keys return 503 while the developer API is disabled. | Use anonymous URL extraction or try again later. |
| 503 | checkout_disabled | Purchases are paused. | Try again later. |
| 503 | price_unavailable | Credit pack is unavailable. | Try another pack or retry later. |
| 503 | queue_unavailable | Inspection or conversion could not start. | Retry later; a failed start refunds credits. |
| 504 | fetch_timeout | Source 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
| Code | Meaning | What to do |
|---|---|---|
| -32700 | Invalid JSON. | Send a valid JSON body. |
| -32600 | Invalid request. | Use a JSON-RPC request with a method. |
| -32601 | Unknown method. | Use initialize, tools/list, or tools/call. |
| -32602 | Unknown tool or invalid arguments. | Check tools/list and its input schemas. |
Resources for agents
- /llms.txt: Concise product and workflow guidance.
- /llms-full.txt: Expanded reference and troubleshooting.
- /openapi.json: Endpoint schemas and operation IDs.
- /developers.md: This page as Markdown.
- /api/agent/status: Current capabilities as JSON.
- /index.md: Homepage as Markdown; also available with Accept: text/markdown.
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.