API Pexels

Pexels Recherche de photos API

Search Pexels for free stock photos by keyword. Returns image URLs in several sizes, dimensions, alt text, the photographer's name and profile, and the photo's Pexels page.

POST/v1/run/pexels.search_photos
Disponibilité
100,00%
30d · 8 appels
Requêtes
8
30d
Réponse
6,9s
médiane · 30d

Tarifs et fournisseurs

Tarifs de l’API Pexels Recherche de photos : une API, 2 fournisseurs interchangeables

Le fournisseur le moins cher répond en premier. S’il échoue, le suivant prend le relais dans le même appel.

Vous payez
31,71 $US
3,17 $US/1k résultats, seulement pour ce que vous utilisez. Aucun forfait mensuel.
Une requête coûte au plus 0,0666 $US (21 results).
Le solde de départ de 0,10 $US couvre au moins 1 requêtes.

L’appeler

Obtenez Pexels Recherche de photos en une requête

import os, requests

res = requests.post(
    "https://api.getanyapi.com/v1/run/pexels.search_photos",
    headers={"Authorization": f"Bearer {os.environ['ANYAPI_KEY']}"},
    json={
        "query": ""
    },
)
print(res.json())
Ouvrir dans
Obtenir une clé gratuite
Exemple de réponse
{
  "data": {
    "photos": [
      {
        "alt": "example",
        "color": "#1f4fe0",
        "colors": [
          "#1f4fe0"
        ],
        "createdUtc": 12.5,
        "downloadUrl": "https://example.com/page",
        "height": 42,
        "id": "a1b2c3d4",
        "image": "https://example.com/image.jpg",
        "imageMedium": "https://example.com/image.jpg",
        "imageOriginal": "https://example.com/image.jpg",
        "license": "example",
        "orientation": "example",
        "photographer": "https://example.com/image.jpg",
        "photographerAvatarUrl": "https://example.com/image.jpg",
        "photographerInstagramUsername": "https://example.com/image.jpg",
        "photographerLocation": "https://example.com/image.jpg",
        "photographerUrl": "https://example.com/image.jpg",
        "photographerUsername": "https://example.com/image.jpg",
        "publishedUtc": 12.5,
        "tags": [
          "example"
        ],
        "thumbnail": "https://example.com/image.jpg",
        "title": "Example title",
        "url": "https://example.com/page",
        "width": 1024
      }
    ]
  },
  "found": true,
  "reason": "not_found"
}

Référence complète des paramètres et de la réponse : chaque champ, type et exemple de cet endpoint.

Référence

Une requête, une seule forme de réponse.

Chaque champ que vous envoyez et chaque champ que vous recevez, avec un vrai exemple.

Dernière vérification : 2026-10-07 · disponibilité et latence mesurées sur 30d

Corps de la requête

JSON, envoyé à cet endpoint.

  • querystring

    coffee

    Keyword or phrase to search Pexels photos for, e.g. "coffee" or "city skyline".

  • limitinteger

    2

    Maximum number of photos to return (1-20, default 20). You are billed per photo returned, so a lower limit costs less.

  • minHeightinteger

    Only return photos at least this many pixels tall.

  • minWidthinteger

    Only return photos at least this many pixels wide.

  • orientationenum

    Only return photos with this orientation. Omit for any orientation.

  • peopleCountenum

    Only return photos showing this many people: "0" for none, "1" or "2". Omit for any number.

  • requireFieldsarray

    Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `tags`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a photo that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge.

Vous envoyez. Un petit corps JSON. Les valeurs affichées sont des exemples à remplacer par les vôtres.

Réponse

JSON, une valeur d’exemple par champ.

each photodata.photos[]

Free Pexels photos matching the keyword, in Pexels' relevance order.

  • altstring

    Alt text describing the photo. Populated whenever the provider has data for the entity.

  • colorstring

    Dominant color as a hex code, e.g. "#918c79".

  • colorsstring[]

    Palette of the photo's main colors as hex codes.

  • createdUtcnumber

    When the photo was uploaded. UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds.

  • downloadUrlstring

    Direct download URL for the full-quality file.

  • heightinteger

    Original height in pixels. Populated whenever the provider has data for the entity.

  • idstring

    Photo id on the source site. Populated whenever the provider has data for the entity.

  • imagestring

    Display-size image URL, 1440 px wide. The query parameters set the size, so keep the URL intact. Populated whenever the provider has data for the entity.

  • imageMediumstring

    Medium image URL, 750 px wide.

  • imageOriginalstring

    Full-resolution original image URL. Populated whenever the provider has data for the entity.

  • licensestring

    License the photo is published under. "Pexels" means the Pexels License: free to use, attribution appreciated but not required. Populated whenever the provider has data for the entity.

  • orientationstring

    landscape, portrait, or square.

  • photographerstring

    Photographer's display name, for attribution. Populated whenever the provider has data for the entity.

  • photographerAvatarUrlstring

    Photographer's profile picture URL.

  • photographerInstagramUsernamestring

    Photographer's Instagram username, when they list one on Pexels.

  • photographerLocationstring

    Photographer's location as they state it on Pexels, when they list one.

  • photographerUrlstring

    Photographer's Pexels profile page, for attribution. Populated whenever the provider has data for the entity.

  • photographerUsernamestring

    Photographer's Pexels handle, without the leading @.

  • publishedUtcnumber

    When Pexels published the photo. UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds.

  • tagsstring[]peut exiger

    Pexels' tags for the photo. One source returns at most 25 tags; name tags in requireFields to be served the full list.

  • thumbnailstring

    Thumbnail image URL, 130 px tall.

  • titlestring

    Photo title set by the photographer.

  • urlstring

    The photo's page on pexels.com. Populated whenever the provider has data for the entity.

  • widthinteger

    Original width in pixels. Populated whenever the provider has data for the entity.

top level
  • foundboolean
  • reason"not_found"

    Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost.

Vous recevez. Des champs nommés et typés, dans la même forme quelle que soit la source qui répond.

FAQ

À propos de l’API Pexels Recherche de photos

L’API Pexels Recherche de photos d’AnyAPI renvoie des données Pexels en JSON normalisé à partir d’un appel POST à /v1/run/pexels.search_photos. Search Pexels for free stock photos by keyword. Returns image URLs in several sizes, dimensions, alt text, the photographer's name and profile, and the photo's Pexels page. AnyAPI route chaque requête sur 2 sources et bascule automatiquement quand l’une échoue. Elle coûte 3,17 $US pour 1 000 résultats, et jamais plus de 0,0666 $US pour une seule requête, en dollars US, sans abonnement et sans minimum mensuel. Ces 30 derniers jours, 100,0% des appels Pexels Recherche de photos passés par AnyAPI ont réussi, avec un temps de réponse médian de 6,9 secondes, sur 8 appels mesurés.

Elle coûte 3,17 $US pour 1 000 résultats, et jamais plus de 0,0666 $US pour une seule requête, en dollars US, sans abonnement et sans minimum mensuel. Vous alimentez un portefeuille en USD et chaque appel le débite. Certaines requêtes échouées financées par le portefeuille entraînent des frais de traitement que nous répercutons au prix coûtant, sans marge ; la réponse d’erreur indique le montant facturé.

Search Pexels for free stock photos by keyword. Returns image URLs in several sizes, dimensions, alt text, the photographer's name and profile, and the photo's Pexels page. La réponse est du JSON normalisé avec la même enveloppe que celle de tous les endpoints AnyAPI, donc analyser un second endpoint revient à changer l’URL et rien d’autre.

Ces 30 derniers jours, 100,0% des appels Pexels Recherche de photos passés par AnyAPI ont réussi, avec un temps de réponse médian de 6,9 secondes, sur 8 appels mesurés. Ce sont les propres mesures d’AnyAPI du trafic passant par la passerelle, recalculées en continu, et non un objectif de niveau de service publié.

Oui. Un nouveau compte AnyAPI démarre avec 0,10 $US de solde gratuit, sans carte, ce qui couvre au moins 1 appels Pexels Recherche de photos à 0,0666 $US chacun au maximum.

AnyAPI interroge la suivante de ses 2 sources dans la même requête, la moins chère d’abord, donc la panne d’une source ne fait pas échouer votre appel.

Envoyez une requête POST à https://api.getanyapi.com/v1/run/pexels.search_photos avec votre clé AnyAPI dans un en-tête « Authorization: Bearer » et l’entrée en corps JSON. La même clé et le même portefeuille fonctionnent sur tous les endpoints AnyAPI.

Non. Vous ajoutez des dollars US à un solde AnyAPI prépayé unique et chaque requête le débite. Il n’y a ni forfait mensuel ni minimum, et le même solde paie tous les endpoints AnyAPI.

Oui. Installez @getanyapi/sdk depuis npm pour TypeScript ou getanyapi depuis pip pour Python. Les deux appellent chaque endpoint AnyAPI avec la même clé, et n’importe quel client HTTP fonctionne aussi.

Oui. Un agent peut se connecter au serveur MCP d’AnyAPI à https://api.getanyapi.com/mcp, ou créer sa propre clé d’essai gratuit avec un seul POST non authentifié vers https://api.getanyapi.com/agent/signup et appeler cet endpoint en HTTP.