Skip to content

All providers / unofficial-api-for-pornhub

Pornhub API.

Retrieve Pornhub video metadata, tags, and category records with an async Python client.

Unofficial Python library · v6.0.3 · AGPL-3.0-only

Install
pip install unofficial-api-for-pornhub
Run the example ↓ Package quickstart ↗

Search Pornhub videos by production type

Search for interviews, keep professional productions, and sort by most viewed. Print the video URLs from the first page.

After installing the package above, save this as example.py and run python example.py.

example.py
import asyncio
from pornhub_api import Client


async def main():
    client = Client()
    try:
        results = client.search_videos(
            query="interview",
            production_type="professional",
            sort_by="mv",
            pages=1,
        )
        async for result in results:
            video = result.unwrap()
            print(video.url)
    finally:
        await client.core.close()


asyncio.run(main())

Expected output
One matching video URL per line. An empty first page produces no lines.

Client.search_videos() reference ↗

What you can build with Pornhub

Metadata fields

  • title
  • duration
  • tags
  • views
  • categories
  • likes
  • publish_date
  • available_qualities
  • author_name
  • rating_percent

The API loader supplies title, duration, and tags. Enable HTML loading for uploader details and advertised qualities.

Release and tests

Release 6.0.3 was published on 2026-11-27. 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 ↗