Python Screenshot API
Capture pixel-perfect screenshots of any URL with one HTTP request in Python — no Selenium, no headless Chrome, no servers to maintain.

Take a screenshot in Python
No SDK and no Selenium — the Microlink REST API turns any URL into a hosted screenshot with a single HTTP GET. Here it is with the popular requests package; the standard library works too.
Step 01 · Install requests
The most convenient way to talk to the API. Prefer zero dependencies? Skip this and use urllib from the standard library.
pip install requestsStep 02 · Capture any URL
Point it at a page, ask for a screenshot, and read the hosted image URL back from the JSON response.
capture.py
import requests
res = requests.get('https://api.microlink.io', params={
'url': 'https://example.com',
'screenshot': 'true',
'meta': 'false' # skip metadata extraction for a faster response
})
data = res.json()['data']
print(data['screenshot']['url'])Step 03 · Customize the capture
Output format, full-page captures, device emulation, and ad blocking — every Headless Chrome option is just a query field (dot notation for nested ones).
options.py
res = requests.get('https://api.microlink.io', params={
'url': 'https://example.com',
'screenshot.type': 'jpeg', # png (default) | jpeg
'screenshot.fullPage': 'true', # capture the entire scrollable page
'device': 'iPhone X', # emulate any device
'adblock': 'true', # strip ads & cookie banners (default)
'meta': 'false'
})
print(res.json()['data']['screenshot']['url'])Step 04 · Save it to disk
The response is a hosted image URL on a global CDN. Download it with a second request, or just hand the URL to the browser.
save.py
import requests
res = requests.get('https://api.microlink.io', params={
'url': 'https://example.com',
'screenshot': 'true'
})
image_url = res.json()['data']['screenshot']['url']
with open('screenshot.png', 'wb') as file:
file.write(requests.get(image_url).content)Drop it into your framework
A view, a route, or a standalone script — the same request becomes your own screenshot endpoint, perfect for dynamic Open Graph images on any runtime.
- Flask
- Django
- FastAPI
- Python
from django.http import HttpResponseRedirect
import requests
# GET /screenshot?url=https://example.com
def screenshot(request):
res = requests.get('https://api.microlink.io', params={
'url': request.GET['url'],
'screenshot': 'true',
'meta': 'false'
})
return HttpResponseRedirect(res.json()['data']['screenshot']['url'])Skip the Selenium maintenance
Driving Headless Chrome from Python means shipping a 300 MB browser, pinning ChromeDriver, and fighting cold starts. The API gives you the same control without any of the infrastructure.
Self-hosted Selenium
- Install & pin ChromeDriver to match every Chrome update
- Bundle headless Chrome (~300 MB) into your image or Lambda layer
- Each browser eats hundreds of MB of RAM; workers crash under load
- Launching Chrome adds seconds of cold-start latency
- You build the pooling, queueing, retries and autoscaling
- Write your own cookie-banner & ad dismissal scripts
Microlink for Python
- One HTTP request — works with requests or the standard library
- Runs anywhere: serverless, containers, a cron job, your laptop
- Autoscaled managed browser fleet with a 99.95% uptime SLA
- Sub-second cached responses from 240+ edge locations
- Built-in adblock removes ads & cookie banners automatically
- Full-page, device emulation, overlays & DOM interaction included
Built for the way you write Python.
A REST API that feels native in Python — one HTTP call, JSON back, and at home in any runtime from a Django app to an AWS Lambda. Read the screenshot guide to go deeper.
No Browser to Install
Skip Selenium and ChromeDriver entirely. There is no headless Chrome to download, pin, or keep in sync with Chrome releases.
requests or Standard Library
Use the popular requests package or the built-in urllib — it is a plain HTTP GET either way, with no extra dependencies required.
Framework Friendly
Drop it into Django, Flask, or FastAPI as a view or route in a few lines. The same request works everywhere.
Serverless Ready
No 250 MB Chrome layer to bundle. Deploy to AWS Lambda, Google Cloud Functions, or any container with zero browser binaries.
Simple JSON Response
A single request returns JSON with the hosted image URL. No drivers, no explicit waits, no browser lifecycle to manage.
Zero Infrastructure
Managed Headless Chrome, autoscaled and load-balanced. No browser pool, no servers, no patching to maintain.
Built-in Adblock
Captures arrive clean — GDPR cookie banners, newsletter popups, and injected ads are removed before the shot.
Full Browser Control
Full-page captures, viewport and device emulation, click and wait, plus custom CSS and JavaScript injection.
Generous Free Tier
Start with 50 requests per day — no account, no credit card. Add an API key when you are ready to scale.
No Browser to Install
Skip Selenium and ChromeDriver entirely. There is no headless Chrome to download, pin, or keep in sync with Chrome releases.requests or Standard Library
Use the popular requests package or the built-in urllib — it is a plain HTTP GET either way, with no extra dependencies required.Framework Friendly
Drop it into Django, Flask, or FastAPI as a view or route in a few lines. The same request works everywhere.
Serverless Ready
No 250 MB Chrome layer to bundle. Deploy to AWS Lambda, Google Cloud Functions, or any container with zero browser binaries.Simple JSON Response
A single request returns JSON with the hosted image URL. No drivers, no explicit waits, no browser lifecycle to manage.Zero Infrastructure
Managed Headless Chrome, autoscaled and load-balanced. No browser pool, no servers, no patching to maintain.
Built-in Adblock
Captures arrive clean — GDPR cookie banners, newsletter popups, and injected ads are removed before the shot.Full Browser Control
Full-page captures, viewport and device emulation, click and wait, plus custom CSS and JavaScript injection.Generous Free Tier
Start with 50 requests per day — no account, no credit card. Add an API key when you are ready to scale.
Try it live in the playground
Paste a URL and see the exact API request before you write a line of Python.
Python Screenshot FAQ
Everything Python developers ask before integrating the Microlink screenshot API.
Do I need Selenium or a headless browser?
No. It is a plain HTTP request to the Microlink API — there is no ChromeDriver to pin and no Chromium binary to download. The Headless Chrome fleet runs on Microlink's side.
That is what makes it deploy cleanly to serverless and container environments where bundling
Selenium
is painful.Should I use requests or the standard library?
Either.
requests is the most convenient, but urllib from the standard library works with zero dependencies — both just issue an HTTP GET and read JSON back.Does it work with Django, Flask, and FastAPI?
Yes. Because it is just an HTTP call, it drops into any view or route handler in a few lines — see the tabs above for Flask, Django, and FastAPI, or the screenshot guide.
Does it run on AWS Lambda or serverless?
Yes. Because there is no Chrome binary to bundle, it works inside AWS Lambda, Google Cloud Functions, and any container out of the box — no 250 MB browser layer required.
See the API overview for request details.
Is there a free tier or do I need an API key?
The free tier gives you 50 requests per day with no account, no credit card, and no API key. Just call the endpoint and start capturing.
When you need more throughput or caching control, add an
apiKey header and requests route to the Pro tier. See pricing for the limits.How fast is it and how does it scale?
Cached captures return sub-second from a global edge network, and the browser fleet autoscales behind a 99.95% uptime SLA — so a traffic spike does not mean provisioning more workers.
Compare the numbers on the screenshot API benchmarks.
Start capturing in Python
Get 50 requests/day with zero commitment — no account and no credit card. Send your first request and ship a screenshot in minutes.
No login needed
50 reqs/day free
No credit card