API di Pexels

Pexels Ricerca foto 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 chiamate
Richieste
8
30d
Risposta
6,9s
mediana · 30d

Chiamalo

Ottieni Pexels Ricerca foto in una sola richiesta

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())
Apri in
Risposta di esempio
{
  "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"
}

Riferimento completo di parametri e risposta - ogni campo, tipo ed esempio per questo endpoint.

Riferimento

Una richiesta, una sola forma di risposta.

Ogni campo che invii e ogni campo che ricevi, ciascuno con un esempio reale.

Ultima verifica 2026-10-07 · disponibilità e latenza misurate su 30d

Corpo della richiesta

JSON, inviato a questo 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.

Tu invii. Un piccolo corpo JSON. I valori mostrati sono esempi da sostituire con i tuoi.

Risposta

JSON, un valore di esempio per campo.

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[]può richiedere

    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.

Tu ricevi. Campi con nome e tipo nella stessa struttura, qualunque fonte risponda.

FAQ

Sull'API Pexels Ricerca foto

L'API Pexels Ricerca foto di AnyAPI restituisce dati Pexels come JSON normalizzato da una sola chiamata POST a /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 instrada ogni richiesta su 2 fonti e passa automaticamente a un'altra quando una fallisce. Costa 3,17 USD ogni 1.000 risultati, e mai più di 0,0666 USD per una singola richiesta, in dollari statunitensi, senza abbonamento e senza minimo mensile. Negli ultimi 30 giorni, il 100,0% delle chiamate Pexels Ricerca foto tramite AnyAPI è riuscito, con un tempo di risposta mediano di 6,9 secondi su 8 chiamate misurate.

Costa 3,17 USD ogni 1.000 risultati, e mai più di 0,0666 USD per una singola richiesta, in dollari statunitensi, senza abbonamento e senza minimo mensile. Ricarichi un portafoglio in USD e ogni chiamata lo scala. Alcune richieste fallite finanziate dal portafoglio comportano costi di elaborazione che trasferiamo al costo, senza ricarico; la risposta di errore mostra l'importo addebitato.

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 risposta è JSON normalizzato con la stessa busta che restituisce ogni endpoint AnyAPI, quindi analizzare un secondo endpoint significa cambiare l'URL e nient'altro.

Negli ultimi 30 giorni, il 100,0% delle chiamate Pexels Ricerca foto tramite AnyAPI è riuscito, con un tempo di risposta mediano di 6,9 secondi su 8 chiamate misurate. Sono misurazioni di AnyAPI sul traffico che passa dal gateway, ricalcolate di continuo, non un obiettivo di livello di servizio pubblicato.

Sì. Un nuovo account AnyAPI parte con 0,10 USD di saldo gratuito e senza bisogno di carta, che copre almeno 1 chiamate Pexels Ricerca foto a un massimo di 0,0666 USD ciascuna.

AnyAPI interroga la successiva delle sue 2 fonti nella stessa richiesta, partendo dalla più economica, quindi una fonte che cade non fa fallire la tua chiamata.

Invia una richiesta POST a https://api.getanyapi.com/v1/run/pexels.search_photos con la tua chiave AnyAPI in un header "Authorization: Bearer" e l'input come corpo JSON. La stessa chiave e lo stesso portafoglio funzionano su ogni endpoint AnyAPI.

No. Aggiungi dollari statunitensi a un unico saldo prepagato AnyAPI e ogni richiesta lo scala. Non c'è un piano mensile né un minimo, e lo stesso saldo paga ogni endpoint AnyAPI.

Sì. Installa @getanyapi/sdk da npm per TypeScript o getanyapi da pip per Python. Entrambi chiamano ogni endpoint AnyAPI con la stessa chiave, e funziona anche qualsiasi client HTTP.

Sì. Un agente può collegarsi al server MCP di AnyAPI su https://api.getanyapi.com/mcp, oppure creare da solo la propria chiave di prova gratuita con un POST non autenticato a https://api.getanyapi.com/agent/signup e chiamare questo endpoint via HTTP.