// Stay in touch?
Products
Encore CloudEncore Cloud
Encore.tsEncore.ts
Encore.goEncore.go
PricingPricing
Book a DemoBook a Demo
Use Cases
AI-Powered DevelopmentAI-Powered Development
Event-Driven SystemsEvent-Driven Systems
Distributed SystemsDistributed Systems
Case StudiesCase Studies
ShowcaseShowcase
Resources
DocsDocs
InstallInstall
Example AppsExample Apps
Demo videoDemo video
ArticlesArticles
ResourcesResources
GitHub ReleasesGitHub Releases
Systems Operational
Company
About UsAbout Us
Swag ShopSwag Shop
ContactContact
JobsJobs
PressPress
TermsTerms
Privacy PolicyPrivacy Policy
Data Processing AgreementData Processing Agreement
Enterprise SLAEnterprise SLA
Encore
© 2026 EncoreAll rights reserved
© 2026 Encore All Rights Reserved
GitHubDiscordYouTube

See all Templates

Pexels Photo & Video Library

Give your users access to free photos and videos from Pexels

Tags

Integration

Use Case

Bits

Author

Encore

Repo

Open on GitHub

Run this template in 60 seconds by installing Encore:

macOS
Windows
Linux
Brew
$ brew install encoredev/tap/encore

Pexels Photo & Video Library

This is an Encore package for searching and retrieving photos and videos from Pexels.

Installation

  1. Copy over the pexels package directory to your Encore application.
  2. Sync your project dependencies by running go mod tidy.

Pexels API Key

You will need an API key from Pexels to use this package. You can get one by signing up for a free account at https://www.pexels.com/.

Once you have the API key, set it as an Encore secret using the name PexelsApiKey:

$ encore secret set --type dev,prod,local,pr PexelsApiKey Enter secret value: ***** Successfully updated development secret PexelsApiKey.

Endpoints

The pexels package contains the following endpoints:

  • pexels.SearchPhotos - Search Pexels for photos.

  • pexels.CuratedPhotos - Receive real-time photos curated by the Pexels team.

  • pexels.GetPhoto - Retrieve a specific photo.

  • pexels.SearchVideos - Search Pexels for videos.

  • pexels.PopularVideos - Retrieve the current popular Pexels videos.

  • pexels.GetVideo - Retrieve a specific video.

  • pexels.FeaturedCollections - Retrieve all featured collections on Pexels.

  • pexels.MyCollections - Returns all of your collections.

  • pexels.CollectionMedia - Returns all the media (photos and videos) within a single collection.

Frontend example usage

After generating a request client for your frontend you can call the endpoints like this:

// Making request to locally running backend... const client = new Client(Local); // or to a specific deployed environment const client = new Client(Environment("staging")); const resp = await client.pexels.SearchPhotos({ Query: "cats", Page: 1, PerPage: 15, Color: "", Locale: "", Size: "", Orientation: "", }); console.log(resp.total_results); console.log(resp.photos);

Learn More

  • Encore Documentation
  • Pexels Documentation