CodiGen Hub API Documentation

Powerful APIs for web developers to fetch YouTube thumbnails, check broken links, and extract source code from any website.

Overview

Thumbnail API
Extract high-quality thumbnails from YouTube videos

Easily fetch thumbnails in various resolutions from any YouTube video URL. Perfect for creating video galleries or previews.

Broken Links API
Scan websites for broken links and errors

Identify broken links on any website to improve SEO and user experience. Get detailed error reports for each broken URL.

Source Code API
Extract source code from any website

Fetch and analyze the source code of any webpage. Great for developers, researchers, and SEO specialists.

Authentication

How to Access Our APIs
We use a purchase-based authentication system

Unlike traditional API systems that use tokens, CodiGen Hub employs strict methods to prevent unauthorized API usage:

  • Purchase any API through our purchase page
  • Get a 3-day trial with a $1 payment (refunded after trial ends)
  • The $1 payment is for authentication purposes only
  • Once purchased, you'll receive immediate access to the API endpoints

API Endpoints

Thumbnail API

Endpoint: Get Thumbnail
https://thumbnail.codigenhub.site/api/thumbnail

Description

Extracts the highest quality thumbnail from a YouTube video URL.

Request

Method: GET

Parameters:

  • url - The YouTube video URL (required)

Response

Success Response:

{
  "success": true,
  "videoId": "dQw4w9WgXcQ",
  "bestThumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg"
}

Error Response:

{
  "success": false,
  "error": "Invalid YouTube URL"
}
Endpoint: Download Thumbnail
https://thumbnail.codigenhub.site/api/download

Description

Downloads a YouTube thumbnail image directly.

Request

Method: GET

Parameters:

  • url - The thumbnail URL (required)

Response

Success Response:

Returns the image file with appropriate content-type headers.

Code Example

// API URL
const API_BASE_URL = 'https://thumbnail.codigenhub.site';

// Fetch thumbnail
async function fetchThumbnail(youtubeUrl) {
  try {
    const response = await fetch(`${API_BASE_URL}/api/thumbnail?url=${encodeURIComponent(youtubeUrl)}`);
    const data = await response.json();

    if (response.ok) {
      console.log('Thumbnail URL:', data.bestThumbnail);
      console.log('Video ID:', data.videoId);
      return data;
    } else {
      console.error('Error:', data.error);
      return null;
    }
  } catch (error) {
    console.error('Network error:', error);
    return null;
  }
}

// Download thumbnail
async function downloadThumbnail(thumbnailUrl, videoId) {
  try {
    const response = await fetch(`${API_BASE_URL}/api/download?url=${encodeURIComponent(thumbnailUrl)}`);
    
    if (!response.ok) throw new Error('Download failed');
    
    const blob = await response.blob();
    
    // Create blob URL and trigger download
    const blobUrl = window.URL.createObjectURL(blob);
    const tempLink = document.createElement('a');
    tempLink.href = blobUrl;
    tempLink.download = `youtube-thumbnail-${videoId}.jpg`;
    document.body.appendChild(tempLink);
    tempLink.click();
    document.body.removeChild(tempLink);
    
    // Clean up blob URL
    window.URL.revokeObjectURL(blobUrl);
  } catch (error) {
    console.error('Download error:', error);
  }
}

Source Code API

Endpoint: Fetch Source
https://fetch-source.codigenhub.site/api/fetch-source

Description

Fetches and returns the source code of any webpage. The API can return both raw and cleaned HTML.

Request

Method: POST

Headers:

Content-Type: application/json

Body:

{
  "url": "https://example.com"
}

Response

Success Response:

{
  "success": true,
  "data": "<!DOCTYPE html><html>...</html>"
}

Error Response:

{
  "success": false,
  "error": "Failed to fetch URL: Network error"
}

Code Example

async function fetchSourceCode(url) {
  try {
    // Show loading state
    console.log('Fetching source code...');
    
    const response = await fetch("https://fetch-source.codigenhub.site/api/fetch-source", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ url })
    });

    if (!response.ok) {
      const errorData = await response.json();
      throw new Error(errorData.error || `Server error: ${response.status}`);
    }

    const data = await response.json();
    
    if (data.success && data.data) {
      console.log('Source code fetched successfully!');
      return data.data;
    } else {
      throw new Error(data.error || 'Invalid response format');
    }
  } catch (error) {
    console.error('Error fetching source code:', error.message);
    return null;
  }
}

// Usage example
fetchSourceCode('https://example.com')
  .then(sourceCode => {
    if (sourceCode) {
      // Display or process the source code
      document.getElementById('sourceCode').value = sourceCode;
    }
  });

Frequently Asked Questions

How do I get started with the API?

To get started, visit our purchase page and select the API you want to use. You can start with a 3-day trial for just $1 (refunded after the trial ends).

Do I need an API key?

No, we don't use a traditional token system. Instead, we use other strict methods to prevent unauthorized API usage. Once you purchase access, you can use the API endpoints directly.

Are there any rate limits?

Yes, our APIs have fair usage policies to ensure optimal performance for all users. Specific rate limits are provided after purchase and vary by API and subscription level.

Can I use these APIs in commercial projects?

Yes, once you purchase access to our APIs, you can use them in both personal and commercial projects. For high-volume commercial use, please contact us for custom pricing.