Skip to content

A FastAPI-based platform that integrates YouTube and Google Ads APIs to search for videos and video advertisements.

Notifications You must be signed in to change notification settings

alphatechlogics/VideoAddsPlatform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Video Ads Platform API

A FastAPI-based platform that integrates YouTube and Google Ads APIs to search for videos and video advertisements.

Features

  • YouTube video search with filters for:
    • Keywords
    • Categories
    • Channel names
  • Video advertisement search with:
    • Keyword filtering
    • Category filtering
    • Channel ID filtering
    • Duration-based filtering (short ads)
  • Channel-based video search
    • Search by channel ID
    • Get channel metadata
    • Filter channel videos
  • Simple token-based authentication
    • No registration required
    • Easy token generation
    • Token expiration handling
  • RESTful API endpoints
  • Swagger/OpenAPI documentation
  • Rate limiting and error handling

Quick Start

  1. Install Dependencies
pip install -r requirements.txt
  1. Configure Environment Variables Create a .env file with:
YOUTUBE_API_KEY=your_youtube_api_key
JWT_SECRET_KEY=your_jwt_secret_key
  1. Run the Application
./run.sh
# or
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
  1. Access API Documentation

API Endpoints

  • POST /api/auth/token
    • Returns: JWT token
    • Description: Generate a token for authentication

Videos

  • GET /api/search-videos
    • Query params: keyword, category, channel_name
    • Returns list of videos with metadata

Advertisements

  • GET /api/search-video-ads
    • Query params: keyword, category
    • Returns list of video advertisements

Unlisted Ads

  • GET /api/search-unlisted-ads
    • Query params: keyword, category, channel_id, duration
    • Returns list of unlisted advertisements

Project Structure

video and ads/
├── app/
│   ├── api/
│   │   ├── routes.py          # API endpoints
│   │   └── auth.py            # Authentication endpoints
│   ├── config/
│   │   └── settings.py        # Configuration management
│   ├── models/
│   │   ├── video.py          # Video data models
│   │   ├── auth.py           # Authentication data models
│   │   ├── unlisted_ad.py       # unlisted data models
│   │   └── ad.py             # Advertisement data models
│   ├── utils/
│   │   └── auth.py            # Authentication utilities
│   ├── middleware/
│   │   └── auth.py            # Authentication middleware
│   ├── services/
│   │   ├── youtube_service.py # YouTube API integration
│   │   ├── unlisted_ad.py     # Unlisted ad integration
│   │   └── ads_service.py     # Ads API integration
│   └── main.py               # FastAPI application
├── .env                      # Environment variables
├── requirements.txt          # Python dependencies
└── run.sh                   # Startup script

offical documentation

About

A FastAPI-based platform that integrates YouTube and Google Ads APIs to search for videos and video advertisements.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published