Pexels-API

Pexels-Fotos suchen-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
Verfügbarkeit
100,00%
30d · 8 Aufrufe
Anfragen
8
30d
Antwort
6,9s
Median · 30d

Aufrufen

Pexels Fotos suchen mit einer Anfrage abrufen

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())
Öffnen in
Beispielantwort
{
  "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"
}

Vollständige Parameter- und Antwortreferenz: jedes Feld, jeder Typ und jedes Beispiel für diesen Endpoint.

Referenz

Eine Anfrage, eine Antwortstruktur.

Jedes Feld, das du sendest, und jedes Feld, das du zurückbekommst, jeweils mit einem echten Beispiel.

Zuletzt geprüft 2026-10-07 · Verfügbarkeit und Latenz gemessen über 30d

Request-Body

JSON, per POST an diesen Endpoint gesendet.

  • 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.

Du sendest. Ein kleiner JSON-Body. Die gezeigten Werte sind Beispiele, die du durch deine eigenen ersetzt.

Antwort

JSON, ein Beispielwert pro Feld.

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[]kann erfordern

    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.

Du bekommst zurück. Benannte, typisierte Felder in derselben Struktur, egal welche Quelle antwortet.

FAQ

Über die Pexels-Fotos suchen-API

Die AnyAPI-Pexels-Fotos suchen-API liefert Pexels-Daten als normalisiertes JSON aus einem POST-Aufruf an /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 routet jede Anfrage über 2 Quellen und weicht automatisch aus, wenn eine ausfällt. Sie kostet 3,17 USD pro 1.000 Ergebnisse, und nie mehr als 0,0666 USD für eine einzelne Anfrage, in US-Dollar, ohne Abo und ohne monatliches Minimum. In den letzten 30 Tagen waren 100,0% der Pexels Fotos suchen-Aufrufe über AnyAPI erfolgreich, bei einer mittleren Antwortzeit von 6,9 Sekunden über 8 gemessene Aufrufe.

Sie kostet 3,17 USD pro 1.000 Ergebnisse, und nie mehr als 0,0666 USD für eine einzelne Anfrage, in US-Dollar, ohne Abo und ohne monatliches Minimum. Du lädst ein USD-Guthabenkonto auf, und jeder Aufruf bucht davon ab. Bei manchen fehlgeschlagenen, vom Guthabenkonto bezahlten Anfragen fallen Bearbeitungsgebühren an, die wir zum Selbstkostenpreis ohne Aufschlag weitergeben. Die Fehlerantwort zeigt den berechneten Betrag.

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. Die Antwort ist normalisiertes JSON mit demselben Envelope, den jeder AnyAPI-Endpoint liefert, sodass das Parsen eines zweiten Endpoints nur eine geänderte URL bedeutet.

In den letzten 30 Tagen waren 100,0% der Pexels Fotos suchen-Aufrufe über AnyAPI erfolgreich, bei einer mittleren Antwortzeit von 6,9 Sekunden über 8 gemessene Aufrufe. Das sind AnyAPIs eigene Messungen des Traffics durch das Gateway, laufend neu berechnet, kein veröffentlichtes Service-Level-Ziel.

Ja. Ein neues AnyAPI-Konto startet mit 0,10 USD Gratis-Guthaben, ohne Karte. Das deckt mindestens 1 Pexels-Fotos suchen-Aufrufe zu je bis zu 0,0666 USD.

AnyAPI fragt in derselben Anfrage die nächste seiner 2 Quellen, die günstigste zuerst, sodass der Ausfall einer Quelle deinen Aufruf nicht scheitern lässt.

Sende eine POST-Anfrage an https://api.getanyapi.com/v1/run/pexels.search_photos mit deinem AnyAPI-Schlüssel in einem Header „Authorization: Bearer“ und der Eingabe als JSON-Body. Derselbe Schlüssel und dasselbe Guthabenkonto funktionieren bei jedem AnyAPI-Endpoint.

Nein. Du lädst US-Dollar auf ein Prepaid-AnyAPI-Guthaben, und jede Anfrage bucht davon ab. Es gibt keinen Monatstarif und kein Minimum, und dasselbe Guthaben bezahlt jeden AnyAPI-Endpoint.

Ja. Installiere @getanyapi/sdk von npm für TypeScript oder getanyapi von pip für Python. Beide rufen jeden AnyAPI-Endpoint mit demselben Schlüssel auf, und jeder HTTP-Client funktioniert ebenfalls.

Ja. Ein Agent kann sich mit dem AnyAPI-MCP-Server unter https://api.getanyapi.com/mcp verbinden oder mit einem unauthentifizierten POST an https://api.getanyapi.com/agent/signup einen eigenen kostenlosen Test-Schlüssel erstellen und diesen Endpoint über HTTP aufrufen.