Import a stock photo or video
Copies one search result, by provider and id, into the site's media (images 2400 px wide at most, videos full HD at most), with its alt text and its credit. Free.
POST/v1/sites/{site_id}/media/stock
Requires sites:write. Costs no credits.
Send the provider and id from the search. The file is copied into the site’s media: photos at 2400 pixels wide at most, videos in full HD at most and 20 MB at most. A name already used gets a suffix, so an import never replaces a file the site has.
The media keeps its credit (“Photo by Jane Doe on Pixabay”) and its source_url. Pixabay does not require a credit on the site, but a short credits line is good practice.
Stock pictures set a mood. They never stand in for the business’s real products, people or premises.
Counts toward the same 30 searches and imports a minute per workspace as the search.
Authorizations
Authorizationbearerin headerrequiredPath parameters
site_idstringrequiredThe site's id, or its slug (the address before .atelier201.page).
Body
application/jsonrequiredproviderenum<string>requiredone of: pixabayidstringrequiredlength: 1–20 charsThe result's id, from the search.
kindenum<string>one of: image, videofilenamestringlength: 1–100 charsA name without extension; default from the description.
altstringlength: ≤ 300 charsWhat it shows, for people who cannot see it. Default: the library's description.
Response
Import a stock photo or video
dataRecord<string, object>requiredrequest_idstringrequiredPossible codes: invalid_request, unknown_field, invalid_parameter, invalid_cursor
errorobjectrequiredrequest_idstringrequiredPossible codes: authentication_required, invalid_api_key, api_key_expired, api_key_revoked
errorobjectrequiredrequest_idstringrequiredPossible codes: insufficient_credits
errorobjectrequiredrequest_idstringrequiredPossible codes: insufficient_scope, feature_not_available, admin_required
errorobjectrequiredrequest_idstringrequiredPossible codes: resource_not_found
errorobjectrequiredrequest_idstringrequiredPossible codes: conflict, result_not_ready, idempotency_key_reused
errorobjectrequiredrequest_idstringrequiredPossible codes: result_expired
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large_for_plan
errorobjectrequiredrequest_idstringrequiredPossible codes: rate_limited
errorobjectrequiredrequest_idstringrequiredPossible codes: internal_error
errorobjectrequiredrequest_idstringrequiredPossible codes: service_unavailable
errorobjectrequiredrequest_idstringrequired