Python Metadata API
Extract title, description, image and logo from any URL with one HTTP request in Python — no HTML parsing, no tag soup, no browser to maintain.
Extract metadata in Python
No package and no parser — the Microlink REST API turns any URL into normalized metadata with a single HTTP GET. Here it is with urllib and json from the Python standard library.
Step 01 · Extract any URL
A few lines with the standard library — no pip install to run. Point it at a page and read the metadata from the JSON response.
extract.py
import json
import urllib.parse
import urllib.request
params = urllib.parse.urlencode({'url': 'https://microlink.io'})
with urllib.request.urlopen(f'https://api.microlink.io?{params}') as res:
data = json.load(res)['data']
print(data['title']) # 'Microlink | The web, ready for AI'
print(data['description']) # 'A single API for turning any URL into data…'
print(data['image']['url']) # absolute, CDN-hosted
print(data['logo']['url']) # absolute, CDN-hostedStep 02 · Pick the fields you need
Title, description, publisher, author, date, lang, image and logo all come back in one call — build exactly the object your product needs.
fields.py
import json
import urllib.parse
import urllib.request
params = urllib.parse.urlencode({'url': 'https://microlink.io'})
with urllib.request.urlopen(f'https://api.microlink.io?{params}') as res:
data = json.load(res)['data']
preview = {
'title': data['title'],
'description': data['description'],
'publisher': data['publisher'],
'author': data['author'],
'date': data['date'],
'lang': data['lang'],
'image': (data.get('image') or {}).get('url'),
'logo': (data.get('logo') or {}).get('url'),
}Step 03 · Render JavaScript pages
Tags injected by client-side JavaScript only exist after the page renders — prerender with a real browser and wait for them, still one request.
spa.py
import json
import urllib.parse
import urllib.request
params = urllib.parse.urlencode({
'url': 'https://app.example.com',
'prerender': 'true', # render JS in a real browser first
'waitForSelector': 'h1', # wait until the content exists
})
with urllib.request.urlopen(f'https://api.microlink.io?{params}') as res:
data = json.load(res)['data']
print(data['title'])Step 04 · Build a link preview
Image and logo come back as absolute, CDN-hosted URLs — drop them straight into an img tag and you have a link preview.
link_preview.py
import json
import urllib.parse
import urllib.request
params = urllib.parse.urlencode({'url': 'https://microlink.io'})
with urllib.request.urlopen(f'https://api.microlink.io?{params}') as res:
data = json.load(res)['data']
image = (data.get('image') or data.get('logo') or {}).get('url', '')
html = f'''
<a href="{data['url']}" class="card">
<img src="{image}" alt="" />
<strong>{data['title']}</strong>
<p>{data['description']}</p>
</a>'''Drop it into your framework
A FastAPI route, a Flask endpoint, or an enrichment worker — the same request becomes your own metadata endpoint for link previews and CRM enrichment.
- FastAPI
- Flask
- Enrichment
- Plain Python
import json
import urllib.parse
import urllib.request
from flask import Flask, request, jsonify
app = Flask(__name__)
# GET /preview?url=https://microlink.io
@app.get('/preview')
def preview():
params = urllib.parse.urlencode({'url': request.args['url']})
with urllib.request.urlopen(f'https://api.microlink.io?{params}') as res:
data = json.load(res)['data']
return jsonify({
'title': data['title'],
'description': data['description'],
'image': (data.get('image') or {}).get('url'),
})Skip the tag-parsing maintenance
Rolling your own means fetching HTML, parsing Open Graph and Twitter Cards with BeautifulSoup, merging JSON-LD and oEmbed, and adding Playwright for JavaScript-injected tags. The API gives you normalized metadata from any page without any of the moving parts.
DIY tag parsing
- Fetch the HTML and parse og, twitter and meta tags yourself
- Merge JSON-LD, oEmbed and microdata by hand — every site differs
- Resolve relative image and logo URLs against redirects yourself
- JavaScript-injected tags need a headless browser — a 300 MB binary
- Each browser eats hundreds of MB of RAM per worker
- You build the caching, retries and autoscaling
Microlink for Python
- One HTTP request — urllib from the standard library, no pip install
- Open Graph, Twitter Cards, JSON-LD and oEmbed merged for you
- Image and logo as absolute, CDN-hosted URLs
- JavaScript-injected tags captured with prerender=true
- Cached responses from a global edge network
- Autoscaled fleet with a 99.9% uptime SLA
Built for the way you write Python.
A REST API that feels native in Python — one call, JSON back, and at home in anything from a notebook to a worker fleet. Read the API overview to go deeper.
No HTML Parsing
No tag soup, no regex, no DOM library to install. One HTTP GET returns a normalized JSON object.
Standard Library Only
urllib and json ship with Python — the examples run with zero pip installs and nothing to vendor.
Every Source Merged
Open Graph, Twitter Cards, JSON-LD, oEmbed, microdata and plain HTML tags are merged into a single normalized response.
CDN-Hosted Assets
Image and logo come back as absolute URLs on a global CDN — hot-link them directly, no downloading or proxying.
JavaScript Rendering
Tags injected by client-side JavaScript are captured too, with prerender=true and waitForSelector.
Link Preview Ready
Title, description, image, logo and publisher are exactly the fields a link preview card needs — one call, one card.
Framework Friendly
Drop it into FastAPI, Flask, or an enrichment worker as a route or a few-line function.
Zero Infrastructure
Managed Headless Chrome, autoscaled and load-balanced. No browser pool, no servers, no patching to maintain.
Generous Free Tier
Sign up for a free API key: 25 requests per day with every Pro feature, no credit card.
No HTML Parsing
No tag soup, no regex, no DOM library to install. One HTTP GET returns a normalized JSON object.Standard Library Only
urllib and json ship with Python — the examples run with zero pip installs and nothing to vendor.Every Source Merged
Open Graph, Twitter Cards, JSON-LD, oEmbed, microdata and plain HTML tags are merged into a single normalized response.
CDN-Hosted Assets
Image and logo come back as absolute URLs on a global CDN — hot-link them directly, no downloading or proxying.JavaScript Rendering
Tags injected by client-side JavaScript are captured too, with prerender=true and waitForSelector.Link Preview Ready
Title, description, image, logo and publisher are exactly the fields a link preview card needs — one call, one card.
Framework Friendly
Drop it into FastAPI, Flask, or an enrichment worker as a route or a few-line function.Zero Infrastructure
Managed Headless Chrome, autoscaled and load-balanced. No browser pool, no servers, no patching to maintain.Generous Free Tier
Sign up for a free API key: 25 requests per day with every Pro feature, no credit card.
Try it live in the playground
Paste a URL and see the exact metadata response before you write a line of Python.
Python Metadata API FAQ
Everything Python developers ask before integrating the Microlink metadata API.
Which metadata sources are covered?
Open Graph, Twitter Cards, JSON-LD, oEmbed, microdata, RDFa and plain HTML tags — all merged and normalized into a single JSON response, so you never parse tag soup yourself.
Do I need to install a package?
No. The examples use urllib and json from the Python standard library. If you already use requests or httpx, the same call is one line shorter — see the FastAPI tab above.
What about tags rendered by JavaScript?
Pass
prerender=true and the page is rendered in a real browser before extraction, so tags injected by React, Vue or any client-side framework are captured too. Combine it with waitForSelector to wait for specific content.Are image and logo URLs ready to use?
Yes. They come back as absolute URLs hosted on a global CDN — resolve-relative-URL bugs included — so you can hot-link them directly in an
img tag or store them as-is.Is there a free tier or do I need an API key?
Yes, and it is free: sign up for an API key and you get 25 requests per day with every Pro feature, no credit card. Add it as x-api-key and start extracting.
When you need more volume, pick a paid plan: same key, bigger quota. See pricing for the limits.
How fresh is the metadata?
Responses are cached at the edge with a sane default TTL, and you control freshness per request — see the API overview for cache parameters.
Start extracting in Python
Sign up for a free API key: 25 requests per day with every Pro feature, no credit card. Send your first request and ship metadata in minutes.
Free API key
25 requests/day
No credit card