All providers / unofficial-api-for-xhamster
xHamster API.
Inspect xHamster video duration, rating percentages, and uploader details.
Unofficial Python library · v3.0.0 · AGPL-3.0-only
Install
pip install unofficial-api-for-xhamsterWhat you can build with xHamster
- Fetch videos
Client.get_video() - Search videos
Client.search_videos() - Fetch channels
Client.get_channel() - Fetch pornstar profiles
Client.get_pornstar() - Fetch shorts
Client.get_short() - Download videos
Video.download()
Metadata fields
titledurationrating_percentageuploader_namelikesviewscomments_countorientationmax_resolution
rating_percentage is a numeric percentage when present. Optional fields can be absent on unrated videos.
Use it in Python
Python · async example
from xhamster_api import Client
async def metadata(client: Client, url: str):
video = await client.get_video(url)
return {
"title": video.title,
"duration": video.duration,
"rating_percentage": video.rating_percentage,
}Release and tests
Release 3.0.0 was published on 2026-11-15. Inspect the published distribution, source, and tests for this integration.
Integrating commercially?
The library is free under AGPL-3.0-only. Email me to discuss alternative commercial terms.
Ask about a commercial license ↗