Discover/Pexels API
live

Pexels APIpexels.com

Access Pexels stock photos and videos via API. Search by keyword, filter by color/orientation, browse trending content, photographer galleries, and challenges.

Endpoint health
verified 16h ago
get_trending_photos
search_videos
search_photos
get_media_details
get_photographer_gallery
8/8 passing latest checkself-healing
Endpoints
8
Updated
22d ago

What is the Pexels API?

This API exposes 8 endpoints covering Pexels stock photos and videos, including keyword search, trending feeds, photographer galleries, and challenge listings. The search_photos endpoint accepts filters for color, orientation, and size and returns paginated photo objects with full image URLs, tags, dimensions, and uploader metadata. Video search follows the same pattern and includes direct MP4 source links.

Try it
Page number for pagination
Filter by size: large, medium, small
Filter by dominant color: red, orange, yellow, green, turquoise, blue, violet, pink, brown, black, gray, white
Search keyword for photos
Number of results per page
Filter by orientation: landscape, portrait, square
api.parse.bot/scraper/f2821378-6172-4989-855b-48dce77e55be/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/f2821378-6172-4989-855b-48dce77e55be/search_photos?page=1&size=large&color=red&query=nature&per_page=5&orientation=landscape' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace pexels-com-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""Pexels API — search photos/videos, browse trending, explore photographer galleries."""
from parse_apis.pexels_api import Pexels, Color, Orientation, ChallengeState, MediaNotFound

client = Pexels()

# Search photos with color and orientation filters
for photo in client.photos.search(query="sunset", color=Color.ORANGE, orientation=Orientation.LANDSCAPE, limit=3):
    print(photo.title, photo.width, photo.height)

# Search videos and drill into one result's photographer
video = client.videos.search(query="ocean", limit=1).first()
if video:
    for gallery_photo in client.user(id=video.user.id).gallery(limit=3):
        print(gallery_photo.title, gallery_photo.image_large)

# Browse trending videos
for trending in client.videos.trending(limit=3):
    print(trending.title, trending.duration, trending.src)

# List active challenges using the ChallengeState enum
for challenge in client.challenges.list(state=ChallengeState.ACTIVE, limit=3):
    print(challenge.title, challenge.prize_title, challenge.media_count)

# Get search suggestions
suggestions = client.searchsuggestions.get(query="mount")
print(suggestions.prefix, suggestions.suggestions[:5])

# Typed error handling for a missing media ID
try:
    client.photos.search(query="xyznonexistent999", limit=1).first()
except MediaNotFound as exc:
    print(f"Media not found: {exc.media_id}")

print("exercised: photos.search / videos.search / user.gallery / videos.trending / challenges.list / searchsuggestions.get")
All endpoints · 8 totalmissing one? ·

Full-text search over Pexels photo library by keyword. Supports filtering by dominant color, orientation, and size. Returns paginated results with photo metadata including title, dimensions, tags, user info, and image URLs at multiple resolutions. Each page returns up to per_page items; advance via the page parameter.

Input
ParamTypeDescription
pageintegerPage number for pagination
sizestringFilter by size: large, medium, small
colorstringFilter by dominant color: red, orange, yellow, green, turquoise, blue, violet, pink, brown, black, gray, white
queryrequiredstringSearch keyword for photos
per_pageintegerNumber of results per page
orientationstringFilter by orientation: landscape, portrait, square
Response
{
  "type": "object",
  "fields": {
    "data": "array of photo objects with id, type, and attributes including title, description, width, height, user, tags, and image URLs",
    "total_pages": "integer total number of pages",
    "current_page": "integer current page number",
    "total_results": "integer total number of results"
  },
  "sample": {
    "data": {
      "data": [
        {
          "id": "12377231",
          "type": "photo",
          "attributes": {
            "id": 12377231,
            "slug": "a-green-trees-in-the-forest",
            "tags": [
              "botanical",
              "branches",
              "dense forest"
            ],
            "user": {
              "id": 175964361,
              "slug": "danil-lysov-175964361",
              "last_name": "Lysov",
              "first_name": "Danil"
            },
            "image": {
              "large": "https://images.pexels.com/photos/12377231/pexels-photo-12377231.jpeg?auto=compress&cs=tinysrgb&w=1440",
              "small": "https://images.pexels.com/photos/12377231/pexels-photo-12377231.jpeg?auto=compress&cs=tinysrgb&h=130",
              "medium": "https://images.pexels.com/photos/12377231/pexels-photo-12377231.jpeg?auto=compress&cs=tinysrgb&w=750"
            },
            "title": "A Green Trees in the Forest",
            "width": 1965,
            "height": 3488,
            "created_at": "2022-06-04T08:21:04.000Z",
            "description": "Dense greenery in a tranquil forest setting."
          }
        }
      ],
      "total_pages": 1600,
      "current_page": 1,
      "total_results": 10000
    },
    "status": "success"
  }
}

About the Pexels API

Search and Filter

The search_photos and search_videos endpoints both accept a required query string and optional filters: orientation (landscape, portrait, square), size (large, medium, small), and — for photos — color (red, blue, green, orange, yellow, black, white). Both return a data array of media objects with id, type, attributes (title, description, width, height, user, tags, and URLs), plus a pagination object carrying current_page, total_pages, and total_results.

Media Details and Photographer Galleries

Use get_media_details with a numeric media_id (sourced from any search result) to retrieve the full attribute set for a single photo or video, including all tags, translation data, and every available image or video URL. The get_photographer_gallery endpoint accepts a user_id (the user.id field in any search result) and returns that photographer's full upload history in recency order, paginated with per_page and page controls.

Trending Feeds and Cursor Pagination

get_trending_photos and get_trending_videos return the content currently featured on Pexels. These endpoints use cursor-based pagination rather than page numbers — the response pagination object includes a cursor string and a more_data boolean. Pass the cursor value as the seed parameter to retrieve the next page. Video results include file source URLs and preview URLs.

Suggestions and Challenges

get_search_suggestions takes a query prefix (e.g. "mount") and returns an attributes object with the original prefix and an array of autocomplete suggestions. get_challenges lists active and past Pexels photo/video challenges with title, short_description, prize_title, end_date, medium_type, and media_count, filtered by state (active or past).

Reliability & maintenanceVerified

The Pexels API is a managed, monitored endpoint for pexels.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when pexels.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official pexels.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
16h ago
Latest check
8/8 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Building a stock media search UI with keyword, color, and orientation filtering via search_photos
  • Populating a trending content carousel using cursor-paginated results from get_trending_photos
  • Displaying a photographer's full portfolio by fetching their gallery with get_photographer_gallery
  • Embedding video backgrounds by retrieving MP4 source URLs from search_videos or get_trending_videos
  • Implementing search autocomplete using prefix-based suggestions from get_search_suggestions
  • Listing active creative challenges and their prize details using get_challenges with state=active
  • Fetching full metadata for a known media asset by ID using get_media_details for tags and dimensions
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does Pexels have an official developer API?+
Yes. Pexels offers an official API at https://www.pexels.com/api/ covering photo and video search, curated collections, and individual media lookup. The Parse API covers additional surfaces such as trending feeds, photographer galleries, search suggestions, and challenges that the official API does not expose.
What does the `search_photos` color filter actually accept?+
The color parameter accepts one of seven named values: red, blue, green, orange, yellow, black, or white. It filters results by the dominant color of the photo. Hex codes and other named colors are not supported by this parameter.
How does pagination differ between search endpoints and trending endpoints?+
Search endpoints (search_photos, search_videos, get_photographer_gallery, get_challenges) use standard page-number pagination with page, per_page, current_page, total_pages, and total_results. Trending endpoints (get_trending_photos, get_trending_videos) use cursor-based pagination: pass the cursor string from the previous response's pagination object as the seed input to retrieve the next batch, and check more_data to know if additional pages exist.
Does the API return individual video file resolutions or quality variants?+
Video results include a src URL and a preview_src URL per video object. Separate resolution variants (e.g. 1080p, 720p) are not enumerated as distinct fields in the current response shape. You can fork this API on Parse and revise it to add an endpoint that returns per-resolution file variants if your use case requires them.
Can I retrieve a specific Pexels collection or curated set through this API?+
No collection or curated-set endpoint is currently included. The API covers keyword search, trending feeds, photographer galleries, challenges, and search suggestions. You can fork this API on Parse and revise it to add a collections endpoint targeting specific curated content.
Page content last updated . Spec covers 8 endpoints from pexels.com.
Related APIs in OtherSee all →
unsplash.com API
Search Unsplash photos by keyword and retrieve image URLs, photographer info, and detailed photo metadata such as tags, EXIF, location, and related collections.
textures.com API
Search and browse millions of textures by category or keyword to find high-resolution texture maps with detailed pricing and specifications. Discover the latest content additions, explore free samples, and access complete metadata including available resolutions and texture maps for your projects.
elements.envato.com API
Search and browse millions of creative assets from Envato Elements, including stock photos, videos, music, fonts, and templates across all categories. Get detailed information about specific items, pricing plans, and discover new content through keyword search and category browsing.
images.nasa.gov API
images.nasa.gov API
mywed.com API
Find and connect with photographers worldwide by browsing top-rated professionals, filtering by location, viewing their portfolios and best work, while engaging with the wedding photography community through forums. Discover photographers in your country or city, explore their detailed profiles and photo galleries, and participate in discussions with other users.
peerspace.com API
Search and explore Peerspace venue listings by location and activity type. Retrieve paginated search results with pricing, ratings, capacity, and amenities, then fetch full listing details including equipment, host information, and availability.
cosmos.so API
Search a curated database of images, videos, links, notes, and products by content type, color, and sorting preferences, then browse results with pagination to find exactly what you need. Discover and organize collections of related visual content tailored to your search criteria.
bhphotovideo.com API
Search and browse B&H Photo's massive inventory of cameras, electronics, and photography gear with instant access to pricing, specifications, images, and customer reviews. Filter products by category, compare detailed specs, and discover used items all in one integrated platform.