> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drain.lat/llms.txt
> Use this file to discover all available pages before exploring further.

# Pornhub

> Fetch Pornhub video information and download links.

# Pornhub

**Base URL:** `https://drain.lat/api/v1/pornhub`

<AccordionGroup>
  <Accordion title="GET /video" icon="play">
    Fetch Pornhub video information and download links.

    ```
    GET /api/v1/pornhub/video
    ```

    <ParamField query="url" type="string" required>
      Full Pornhub video URL (e.g. `https://www.pornhub.com/view_video.php?viewkey=xxxxx`).
    </ParamField>

    <CodeGroup>
      ```bash cURL theme={null}
      curl "https://drain.lat/api/v1/pornhub/video?url=https://www.pornhub.com/view_video.php?viewkey=xxxxx" \
        -H "x-api-key: YOUR_API_KEY"
      ```

      ```javascript JavaScript theme={null}
      const videoUrl = "https://www.pornhub.com/view_video.php?viewkey=xxxxx";
      const res = await fetch(
        `https://drain.lat/api/v1/pornhub/video?url=${encodeURIComponent(videoUrl)}`,
        { headers: { "x-api-key": "YOUR_API_KEY" } }
      );
      const data = await res.json();
      ```

      ```python Python theme={null}
      import requests

      video_url = "https://www.pornhub.com/view_video.php?viewkey=xxxxx"
      res = requests.get(
          "https://drain.lat/api/v1/pornhub/video",
          params={"url": video_url},
          headers={"x-api-key": "YOUR_API_KEY"}
      )
      print(res.json())
      ```
    </CodeGroup>

    <ResponseField name="title" type="string">Video title.</ResponseField>
    <ResponseField name="duration" type="number">Video duration in seconds.</ResponseField>
    <ResponseField name="views" type="string">View count (formatted string).</ResponseField>
    <ResponseField name="rating" type="string">Video rating percentage.</ResponseField>
    <ResponseField name="uploader" type="string">Uploader username.</ResponseField>
    <ResponseField name="thumbnail" type="string">Video thumbnail URL.</ResponseField>

    <ResponseField name="qualities" type="array">
      <Expandable title="quality object">
        <ResponseField name="quality" type="string">Video quality (e.g. `720p`, `1080p`).</ResponseField>
        <ResponseField name="url" type="string">Direct download URL for this quality.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="url" type="string">Original video page URL.</ResponseField>

    ```json Response theme={null}
    {
      "title": "Video Title Here",
      "duration": 720,
      "views": "1.2M",
      "rating": "92%",
      "uploader": "username",
      "thumbnail": "https://ci.phncdn.com/videos/...",
      "qualities": [
        {
          "quality": "1080p",
          "url": "https://cv.phncdn.com/videos/..."
        },
        {
          "quality": "720p",
          "url": "https://cv.phncdn.com/videos/..."
        },
        {
          "quality": "480p",
          "url": "https://cv.phncdn.com/videos/..."
        }
      ],
      "url": "https://www.pornhub.com/view_video.php?viewkey=xxxxx",
      "scrapedAt": "2026-05-31T12:00:00.000Z"
    }
    ```

    <Note>
      Download URLs are temporary and expire after a short period. Fetch fresh URLs when needed.
    </Note>
  </Accordion>
</AccordionGroup>
