API Pexels

Pexels Поиск фото 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
Доступность
100,00%
30d · Вызовов: 8
Запросы
8
30d
Ответ
6,9s
медиана · 30d

Цены и поставщики

Цена API Pexels Поиск фото: один API, поставщиков 2, и любой может заменить другого

Первым обслуживает самый дешёвый поставщик. Если он не отвечает, его заменяет следующий в том же вызове.

Поставщик
1OctopusОбслуживает первымДоступность: 100,00%6738ms p50100,0% вызовов3,17 USD/1 тыс. результатовдо 0,0666 USD / запрос2GeckoРезерв 14,67 USD/1 тыс. результатовдо 0,0933 USD / запрос
Вы платите
31,71 USD
3,17 USD/1 тыс. результатов, только за то, чем пользуетесь. Без ежемесячного тарифа.
Один запрос стоит не больше 0,0666 USD (21 results).
Стартового баланса 0,10 USD хватает минимум на 1 запросов.

Вызвать

Получите Pexels Поиск фото одним запросом

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())
Открыть в
Пример ответа
{
  "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"
}

Полный справочник по параметрам и ответу: каждое поле, тип и пример для этого эндпоинта.

Справочник

Один запрос, один формат ответа.

Каждое поле, которое вы отправляете, и каждое поле, которое получаете, с реальным примером.

Проверено 2026-10-07 · доступность и задержка измерены за 30d

Тело запроса

JSON, отправляется на этот эндпоинт.

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

Вы отправляете. Небольшое тело JSON. Показанные значения это примеры, замените их своими.

Ответ

JSON, по одному примеру значения на поле.

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[]может потребовать

    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.

Вы получаете. Именованные типизированные поля в одном формате, какой бы источник ни ответил.

Вопросы и ответы

Об API Pexels Поиск фото

AnyAPI Pexels Поиск фото API возвращает данные Pexels в виде нормализованного JSON одним вызовом 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 направляет каждый запрос по источникам (их 2) и автоматически переключается, если один из них отказывает. Это стоит 3,17 USD за 1000 результатов, и никогда не больше 0,0666 USD за один запрос, в долларах США, без подписки и без ежемесячного минимума. За последние 30 дней 100,0% вызовов Pexels Поиск фото через AnyAPI завершились успешно, медианное время ответа 6,9 с, измерено вызовов: 8.

Это стоит 3,17 USD за 1000 результатов, и никогда не больше 0,0666 USD за один запрос, в долларах США, без подписки и без ежемесячного минимума. Вы пополняете один кошелёк в долларах США, и каждый вызов списывает с него. По некоторым неудавшимся запросам, оплаченным из кошелька, возникают расходы на обработку; мы передаём их по себестоимости, без наценки, а сумма списания указана в ответе с ошибкой.

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. Ответ это нормализованный JSON с тем же конвертом, что возвращает каждый эндпоинт AnyAPI, поэтому разбор второго эндпоинта это смена URL и ничего больше.

За последние 30 дней 100,0% вызовов Pexels Поиск фото через AnyAPI завершились успешно, медианное время ответа 6,9 с, измерено вызовов: 8. Это собственные измерения AnyAPI по трафику через шлюз, пересчитываемые непрерывно, а не опубликованный целевой уровень обслуживания.

Да. Новый аккаунт AnyAPI стартует с бесплатным балансом 0,10 USD, карта не нужна. Этого хватает минимум на 1 вызовов Pexels Поиск фото по цене до 0,0666 USD за каждый.

AnyAPI в том же запросе обращается к следующему из источников (их 2), начиная с самого дешёвого, поэтому отказ одного источника не ломает ваш вызов.

Отправьте запрос POST на https://api.getanyapi.com/v1/run/pexels.search_photos с вашим ключом AnyAPI в заголовке "Authorization: Bearer" и входными данными в теле JSON. Один и тот же ключ и один и тот же кошелёк работают на каждом эндпоинте AnyAPI.

Нет. Вы пополняете один предоплаченный баланс AnyAPI в долларах США, и каждый запрос списывает с него. Ежемесячного тарифа и минимума нет, а один и тот же баланс оплачивает каждый эндпоинт AnyAPI.

Да. Установите @getanyapi/sdk из npm для TypeScript или getanyapi из pip для Python. Оба вызывают любой эндпоинт AnyAPI с одним и тем же ключом, а ещё подойдёт любой HTTP-клиент.

Да. Агент может подключиться к MCP-серверу AnyAPI по адресу https://api.getanyapi.com/mcp или создать собственный бесплатный пробный ключ одним POST без аутентификации на https://api.getanyapi.com/agent/signup и вызывать этот эндпоинт по HTTP.