HTML to Markdown API
Convert a public web page to Markdown by URL.
Endpoint
GET https://api.goanyapi.com/api/v1/html-to-markdown-apiParameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
url | Query | string | Yes | Public HTTP or HTTPS page URL, such as https://example.com. |
retainImages | Query | all | alt | none | No | Image handling: keep images, keep alt text only, or remove images. Default: all. |
retainLinks | Query | all | text | none | No | Link handling: keep links, keep link text only, or remove links. Default: all. |
targetSelector | Query | string | No | CSS selector for the section to extract, such as article. |
Request example
GET /api/v1/html-to-markdown-api?url=https%3A%2F%2Fexample.com&retainImages=alt&retainLinks=all
Authorization: Bearer YOUR_API_KEYBilling
With the current configuration, each successful request costs 1 credit.
The API Tester shows a saved JSON response for https://google.com without making a request or charging credits. Direct API requests for that URL are also free. Other successful conversions use the current configured cost. Failed conversions are free.
Response
| Field | Type | Description |
|---|---|---|
data.url | string | URL of the converted page. |
data.title | string | Page title, or an empty string if unavailable. |
data.description | string | Page description, or an empty string if unavailable. |
data.markdown | string | Converted Markdown content. |
data.creditsUsed | number | Credits charged for this request. |
data.remainingCredits | number | Credits remaining after the request. |
Example response (Google Demo; remaining credits are illustrative):
{
"code": "ok",
"message": "ok",
"data": {
"url": "https://google.com/",
"title": "Google",
"description": "",
"markdown": "[About](https://about.google/?fg=1&utm_source=google-US&utm_medium=referral&utm_campaign=hp-header)[Store](https://store.google.com/US?utm_source=hp_header&utm_medium=google_ooo&utm_campaign=GS100042&hl=en-US)\n\n[Gmail](https://mail.google.com/mail/&ogbl)\n\n[Images](https://www.google.com/imghp?hl=en&ogbl)\n\n[](https://www.google.com/intl/en/about/products)\n\n[Sign in](https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/&ec=futura_exp_og_so_72776762_e)\n\n[](https://www.google.com/webhp?hl=en&ictx=0&sa=X&ved=0ahUKEwjC-9bflsWXAxU4IDQIHY92EskQPAgF)\n\nWhat's on your mind?\n\n* Add images\n* Add files\n* 🍌Create images Canvas \n\nAI Mode\n\n🍌Create Remove Create Images Canvas Remove Canvas\n\nChoose what youre giving feedback on\n\n*   * * *\n\nSee more Delete \n*   \n* \n\nReport inappropriate predictions\n\nI'm Feeling Curious\n\nI'm Feeling Hungry\n\nI'm Feeling Adventurous\n\nI'm Feeling Playful\n\nI'm Feeling Stellar\n\nI'm Feeling Doodley\n\nI'm Feeling Trendy\n\nI'm Feeling Artistic\n\nI'm Feeling Funny\n\nI'm Feeling Mindful\n\n[Advertising](https://www.google.com/intl/en_us/ads/?subid=ww-ww-et-g-awa-a-g_hpafoot1_1!o2&utm_source=google.com&utm_medium=referral&utm_campaign=google_hpafooter&fg=1)[Business](https://www.google.com/services/?subid=ww-ww-et-g-awa-a-g_hpbfoot1_1!o2&utm_source=google.com&utm_medium=referral&utm_campaign=google_hpbfooter&fg=1)[How Search works](https://google.com/search/howsearchworks/?fg=1)\n\n[Build, create, and do more with AI tools from Google](https://ai.google/helpful-tools/?utm_source=googlehpfooter&utm_medium=housepromos&utm_campaign=bottom-footer)\n\n[Privacy](https://policies.google.com/privacy?hl=en&fg=1)[Terms](https://policies.google.com/terms?hl=en&fg=1)\n\nSettings\n\n[Search settings](https://www.google.com/preferences?hl=en&fg=1)\n\n[Advanced search](https://google.com/advanced_search?hl=en&fg=1)\n\n[Your data in Search](https://google.com/history/privacyadvisor/search/unauth?utm_source=googlemenu&fg=1&cctld=com)\n\n[Search history](https://google.com/history/optout?hl=en&fg=1)\n\n[Search help](https://support.google.com/websearch/?p=ws_results_help&hl=en&fg=1)\n\nSend feedback\n\nDark theme: Off\n\nGoogle apps",
"creditsUsed": 0,
"remainingCredits": 466865
}
}