pexels

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package pexels implements the material.Searcher interface for the Pexels stock platform.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey     string
	RPM        int // requests per minute; default 30
	HTTPClient *http.Client
}

Config configures the Pexels searcher.

type Searcher

type Searcher struct {
	// contains filtered or unexported fields
}

Searcher queries the Pexels API for photos and videos.

func New

func New(cfg Config) *Searcher

New creates a Pexels searcher. If APIKey is empty, falls back to PEXELS_API_KEY env var.

func (*Searcher) Search

func (s *Searcher) Search(ctx context.Context, req material.Request) (material.Result, error)

Search queries Pexels for photos and/or videos matching the request.

func (*Searcher) Source

func (s *Searcher) Source() string

func (*Searcher) SupportedMediaTypes

func (s *Searcher) SupportedMediaTypes() []string

Jump to

Keyboard shortcuts

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