Documentation
Installation
Use curl or any HTTP client to fetch Markdown content:
curl https://api.mdfetch.ai/https://github.com/user/repo \
-H "Authorization: Bearer YOUR_TOKEN"
curl https://api.mdfetch.ai/https://github.com/user/repo \
-H "Authorization: Bearer YOUR_TOKEN"
Examples
Fetch Documentation
curl https://api.mdfetch.ai/https://hexdocs.pm/phoenix/overview.html \
-H "Authorization: Bearer YOUR_TOKEN"
curl https://api.mdfetch.ai/https://hexdocs.pm/phoenix/overview.html \
-H "Authorization: Bearer YOUR_TOKEN"
Fetch GitHub Repository
MdFetch automatically fetches the README and repository structure:
curl https://api.mdfetch.ai/https://github.com/phoenixframework/phoenix \
-H "Authorization: Bearer YOUR_TOKEN"
curl https://api.mdfetch.ai/https://github.com/phoenixframework/phoenix \
-H "Authorization: Bearer YOUR_TOKEN"
Fetch Source Code Files
Get raw source code from GitHub, GitLab, or any supported platform:
curl https://api.mdfetch.ai/https://github.com/elixir-lang/elixir/blob/main/lib/elixir/lib/enum.ex \
-H "Authorization: Bearer YOUR_TOKEN"
curl https://api.mdfetch.ai/https://github.com/elixir-lang/elixir/blob/main/lib/elixir/lib/enum.ex \
-H "Authorization: Bearer YOUR_TOKEN"
API Reference
Endpoint
GET https://api.mdfetch.ai/{url}
GET https://api.mdfetch.ai/{url}
Replace
{url}
with the full URL you want to fetch.
Authentication
Include your API token in the Authorization header:
Authorization: Bearer YOUR_TOKEN
Authorization: Bearer YOUR_TOKEN
Rate Limits
- Monitor usage in your dashboard
- See the homepage for pricing details
Volume Pricing
For high-volume production workloads, we offer custom volume pricing with:
- Volume discounts competitive with other providers
- Dedicated support and SLA guarantees available
- Custom rate limits tailored to your needs
- Flexible billing options (monthly, quarterly, annual)
Contact us at contact@mdfetch.ai to discuss volume pricing for your use case.
Response Format
Returns clean Markdown as plain text with UTF-8 encoding:
Content-Type: text/markdown; charset=utf-8
Content-Type: text/markdown; charset=utf-8
Error Codes
-
401- Invalid or missing authentication token -
429- Rate limit exceeded -
500- Server error or failed to fetch URL
Best Practices
🔒 Token Security
- Never commit tokens to version control
- Use environment variables for token storage
- Regenerate tokens if compromised (contact support)
- Keep tokens private and don't share them
âš¡ Performance Tips
- Cache responses when possible to save requests
- Monitor your usage in the dashboard
- Use specific URLs rather than entire websites
- MdFetch automatically optimizes content size
🎯 Content Optimization
- GitHub/GitLab files are fetched as raw source
- Documentation sites preserve structure and code blocks
- HTML is stripped, keeping only content
- Results are optimized for LLM context windows
Frequently Asked Questions
What sites are supported?
MdFetch works with any publicly accessible webpage. It has special optimizations for GitHub, GitLab, documentation sites, and platforms that serve raw content.
Can I use it commercially?
Yes! MdFetch is suitable for both personal and commercial use. Just keep your API token secure.
How much smaller is the output?
Typically 70-90% smaller than raw HTML. This means significantly fewer tokens when sending to LLMs, saving you money and fitting more content in context windows.
What if I need help?
Contact us at hello@mdfetch.ai
Ready to get started?
Sign in with GitHub to get your API token and start fetching clean Markdown.
Get Started Free