youtube

package module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 11 Imported by: 0

README

YouTube clients for Crawlora

Official Crawlora client packages for the hosted YouTube API. These packages send requests to Crawlora's API and require a Crawlora account and CRAWLORA_API_KEY; service usage follows your Crawlora account billing plan.

The packages do not run a browser or scrape YouTube locally. Crawlora is an independent service and is not affiliated with or endorsed by YouTube or its owners.

Create an account at crawlora.net, open the Crawlora console to get an API key, or read the API documentation.

Install

npm install @crawlora-org/youtube
python -m pip install crawlora-youtube
go get github.com/Crawlora-org/crawlora-youtube@latest
gem install crawlora-youtube
composer require crawlora/youtube

For Java, add net.crawlora:crawlora-youtube:0.1.5 to your Maven dependencies; see java/README.md.

Set your Crawlora key in the environment before running a client:

export CRAWLORA_API_KEY="your-crawlora-api-key"

Do not commit API keys. See the language-specific READMEs for sync and async use.

PHP example

The Packagist package is available as crawlora/youtube:

composer require crawlora/youtube
<?php
require __DIR__ . '/vendor/autoload.php';

$apiKey = getenv('CRAWLORA_API_KEY');
if (!$apiKey) throw new RuntimeException('Set CRAWLORA_API_KEY before running this example.');
$client = new \Crawlora\YouTube\Client(apiKey: $apiKey);
$result = $client->request("youtube-search", ['q' => 'science explainers', 'type' => 'video']);
print_r($result);
$client->close();

The same example and install details are in php/README.md.

License

MIT. See LICENSE.

Documentation

Overview

Package youtube is a focused Go client for Crawlora's YouTube endpoints. API documentation: https://crawlora.net/docs?utm_source=pkg.go.dev&utm_medium=referral&utm_campaign=platform-clients&utm_content=youtube-go-api-docs

Index

Constants

View Source
const (
	DefaultBaseURL = "https://api.crawlora.net/api/v1"
	Version        = "0.1.5"
)
View Source
const OperationCount = 14

OperationCount reports how many selected-platform operations this module exposes.

Variables

This section is empty.

Functions

func OperationIDs

func OperationIDs() []string

OperationIDs returns the selected operation IDs in stable sorted order.

Types

type Client

type Client struct {
	APIKey     string
	BaseURL    string
	Timeout    time.Duration
	HTTPClient *http.Client
}

Client calls only the operation IDs included in this platform module.

func NewClient

func NewClient(apiKey string) *Client

NewClient creates a client using the supplied API key, or CRAWLORA_API_KEY when empty.

func (*Client) Call

func (c *Client) Call(ctx context.Context, operationID string, params Params) (any, error)

Call executes a selected platform operation by operation ID.

func (*Client) Captions

func (c *Client) Captions(ctx context.Context, params Params) (any, error)

Captions calls the youtube-captions operation.

func (*Client) ChannelPlaylists

func (c *Client) ChannelPlaylists(ctx context.Context, params Params) (any, error)

ChannelPlaylists calls the youtube-channel-playlists operation.

func (*Client) ChannelSearch

func (c *Client) ChannelSearch(ctx context.Context, params Params) (any, error)

ChannelSearch calls the youtube-channel-search operation.

func (*Client) ChannelShorts

func (c *Client) ChannelShorts(ctx context.Context, params Params) (any, error)

ChannelShorts calls the youtube-channel-shorts operation.

func (*Client) ChannelVideos

func (c *Client) ChannelVideos(ctx context.Context, params Params) (any, error)

ChannelVideos calls the youtube-channel-videos operation.

func (*Client) Close

func (c *Client) Close() error

Close releases idle connections held by the configured HTTP transport.

func (*Client) Comments

func (c *Client) Comments(ctx context.Context, params Params) (any, error)

Comments calls the youtube-comments operation.

func (*Client) Playlist

func (c *Client) Playlist(ctx context.Context, params Params) (any, error)

Playlist calls the youtube-playlist operation.

func (*Client) Profile

func (c *Client) Profile(ctx context.Context, params Params) (any, error)

Profile calls the youtube-profile operation.

func (*Client) Search

func (c *Client) Search(ctx context.Context, params Params) (any, error)

Search calls the youtube-search operation.

func (*Client) Suggest

func (c *Client) Suggest(ctx context.Context, params Params) (any, error)

Suggest calls the youtube-suggest operation.

func (*Client) Tag

func (c *Client) Tag(ctx context.Context, params Params) (any, error)

Tag calls the youtube-tag operation.

func (*Client) Transcript

func (c *Client) Transcript(ctx context.Context, params Params) (any, error)

Transcript calls the youtube-transcript operation.

func (*Client) TranscriptLanguages

func (c *Client) TranscriptLanguages(ctx context.Context, params Params) (any, error)

TranscriptLanguages calls the youtube-transcript-languages operation.

func (*Client) Video

func (c *Client) Video(ctx context.Context, params Params) (any, error)

Video calls the youtube-video operation.

type Params

type Params map[string]any

Params maps the exact OpenAPI parameter names expected by this platform client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL