Pexels API'en giver programadgang til hele Pexels' indholdsbibliotek, herunder fotos og videoer. Alt indhold er gratis, og du er velkommen til at bruge Pexels' indhold til alt, hvad du vil, så længe det falder inden for vores Retningslinjer.
Pexels API'en er en RESTful JSON API, og du kan interagere med den fra alle sprog eller strukturer med et HTTP-bibliotek. Pexels vedligeholder også nogle officielle Klientbiblioteker, som du kan bruge.
Hvis du har spørgsmål, kan du se vores Ofte stillede spørgsmål. Du kan også sende en e-mail til os på [email protected].
Note:
For historical reasons, all endpoints begin with https://api.pexels.com/v1/
except for video endpoints, which begin with https://api.pexels.com/videos/
. Please see the individual endpoints listed below for more details about how to call each endpoint.
Når du foretager en API-anmodning, skal du sørge for at vise et fremtrædende link til Pexels. Du kan f.eks. bruge et tekstlink (f.eks. "Fotos leveret af Pexels") eller et link med vores logo. Du kan f.eks. bruge et tekstlink (f.eks. "Fotos leveret af Pexels") eller et link med vores logo.
Kreditér altid vores fotografer, når det er muligt (f.eks. "Foto af John Doe på Pexels" med et link til fotosiden på Pexels).
Du må ikke kopiere grundstenen i Pexels (herunder gøre Pexels' indhold tilgængeligt som en baggrundsapp).
Du må ikke misbruge API'en. Som standard er API'en begrænset til 200 anmodninger i timen og 20.000 anmodninger om måneden. Du kan kontakte os for at bede om en højere grænse, men husk at medsende eksempler, eller forbered dig på at give en demonstration, der tydeligt viser din brug af API'en med tilskrivning. Hvis du kontakter vores API-teams, kan du få ubegrænsede anmodninger – helt gratis.
Misbrug af Pexels API'en, herunder, men ikke begrænset til forsøg på at omgå hastighedsbegrænsningen, vil medføre ophør af din API-adgang.
1 2 3 4 5 6 7 8 9 10 11 12 13 | <a href="https://www.pexels.com">Photos provided by Pexels</a> <!-- or show our white logo --> <a href="https://www.pexels.com"> <img src="https://images.pexels.com/lib/api/pexels-white.png" /> </a> <!-- or show our black logo --> <a href="https://www.pexels.com"> <img src="https://images.pexels.com/lib/api/pexels.png" /> </a> |
1 | This <a href="https://www.pexels.com/photo/food-dinner-lunch-meal-4147875">Photo</a> was taken by <a href="https://www.pexels.com/@daria">Daria</a> on Pexels. |
Pexels bevarer antallet af officielle API-klientbiblioteker, som du kan bruge til at interagere med Pexels API'en:
Language | Package | Github | Changelog | Version |
Ruby | rubygems | pexels-ruby | changelog | 0.3.0 |
Javascript | npm | pexels-javascript | changelog | 1.2.1 |
.net | nuget | PexelsDotNetSDK | changelog | 1.0.6 |
Læs dokumentationen for det klientbibliotek, du vil bruge, for at få mere at vide om syntaksen (kodeeksempler for hvert bibliotek, der er tilgængeligt med denne dokumentation). Issues og pull-requests på Github er også velkomne!
Hvis du har oprettet et uofficielt Pexels API-bibliotek for et andet sprog, må du gerne fortælle os om det!
Der kræves godkendelse til Pexels API'en. Alle med en Pexels-konto kan anmode om en API-nøgle, som modtages med det samme.
Alle anmodninger, som du foretager til API'en, skal omfatte din nøgle. Dette angives ved at tilføje en Authorization
-header.
1 2 | curl -H "Authorization: YOUR_API_KEY" \ "https://api.pexels.com/v1/search?query=people" |
Du kan se hvor mange anmodninger, du har tilbage af din månedlige kvote ved hjælp af anmodninger fra Pexels API'en, som inkluderer tre HTTP-overskrifter:
Response Header | Meaning |
X-Ratelimit-Limit |
Din samlede anmodningsgrænse for den månedlige periode |
X-Ratelimit-Remaining |
Hvor mange af disse anmodninger, der er tilbage |
X-Ratelimit-Reset |
UNIX-tidsstempel for, hvornår den aktuelle månedlige periode overgår |
Bemærkning:
Disse svaroverskrifter returneres kun for fuldførte (2xx
)-svar. De medtages ikke for andre svar, herunder 429 – For mange anmodninger
, som indikerer, at du har overskredet din begrænsning. Sørg for, at du holder styr på X-begrænsning-tilbage
og X-begrænsning-nulstil
for at kunne administrere din begrænsning for anmodninger.
1 2 3 | X-Ratelimit-Limit: 20000 X-Ratelimit-Remaining: 19684 X-Ratelimit-Reset: 1590529646 |
De fleste Pexels API-anmodninger returnerer flere poster på én gang. Alle disse slutpunkter er nummererede og kan højst returnere 80 anmodninger ad gangen. Alle nummererede anmodninger accepterer de samme parametre og returnerer de samme data for sidenummerering som svar.
Bemærk: Svarattributterne prev_page
og next_page
returneres kun, hvis der er en tilsvarende side.
1 | GET https://api.pexels.com/v1/curated?page=2&per_page=40 |
1 2 3 4 5 6 7 | { "page": 2, "per_page": 40, "total_results": 8000, "next_page": "https://api.pexels.com/v1/curated?page=3&per_page=40", "prev_page": "https://api.pexels.com/v1/curated?page=1&per_page=40" } |
Ressourcen Photo
er en JSON-formateret version af et Pexels-foto. Slutpunktet for API'en for fotos svarer med fotodata, der er formateret på denne måde.
integer
The id of the photo.
integer
The real width of the photo in pixels.
integer
The real height of the photo in pixels.
string
The Pexels URL where the photo is located.
string
The name of the photographer who took the photo.
string
The URL of the photographer's Pexels profile.
integer
The id of the photographer.
string
The average color of the photo. Useful for a placeholder while the image loads.
object
An assortment of different image sizes that can be used to display this Photo
.
string
Text description of the photo for use in the alt
attribute.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | { "id": 2014422, "width": 3024, "height": 3024, "url": "https://www.pexels.com/photo/brown-rocks-during-golden-hour-2014422/", "photographer": "Joey Farina", "photographer_url": "https://www.pexels.com/@joey", "photographer_id": 680589, "avg_color": "#978E82", "src": { "original": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg", "large2x": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", "large": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", "medium": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&h=350", "small": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&h=130", "portrait": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", "landscape": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", "tiny": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" }, "liked": false, "alt": "Brown Rocks During Golden Hour" } |
GET https://api.pexels.com/v1/search
Dette slutpunkt giver dig mulighed for at søge på Pexels efter alle de emner, du vil. Din forespørgsel kan f.eks. være bred såsom Natur
, Tigere
, Mennesker
. Men den kan også være mere specifik, såsom Grupper af mennesker, der arbejder
.
string | required
The search query. Ocean
, Tigers
, Pears
, etc.
string | optional
Desired photo orientation. The current supported orientations are: landscape
, portrait
or square
.
string | optional
Minimum photo size. The current supported sizes are: large
(24MP), medium
(12MP) or small
(4MP).
string | optional
Desired photo color. Supported colors: red
, orange
, yellow
, green
, turquoise
, blue
, violet
, pink
, brown
, black
, gray
, white
or any hexidecimal color code (eg. #ffffff
).
string | optional
The locale of the search you are performing. The current supported locales are: 'en-US'
'pt-BR'
'es-ES'
'ca-ES'
'de-DE'
'it-IT'
'fr-FR'
'sv-SE'
'id-ID'
'pl-PL'
'ja-JP'
'zh-TW'
'zh-CN'
'ko-KR'
'th-TH'
'nl-NL'
'hu-HU'
'vi-VN'
'cs-CZ'
'da-DK'
'fi-FI'
'uk-UA'
'el-GR'
'ro-RO'
'nb-NO'
'sk-SK'
'tr-TR'
'ru-RU'
.
integer | optional
The page number you are requesting. Default: 1
integer | optional
The number of results you are requesting per page. Default: 15
Max: 80
array of Photo
An array of Photo
objects.
integer
The current page number.
integer
The number of results returned with each page.
integer
The total number of results for the request.
string | optional
URL for the previous page of results, if applicable.
string | optional
URL for the next page of results, if applicable.
1 2 | curl -H "Authorization: YOUR_API_KEY" \ "https://api.pexels.com/v1/search?query=nature&per_page=1" |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | { "total_results": 10000, "page": 1, "per_page": 1, "photos": [ { "id": 3573351, "width": 3066, "height": 3968, "url": "https://www.pexels.com/photo/trees-during-day-3573351/", "photographer": "Lukas Rodriguez", "photographer_url": "https://www.pexels.com/@lukas-rodriguez-1845331", "photographer_id": 1845331, "avg_color": "#374824", "src": { "original": "https://images.pexels.com/photos/3573351/pexels-photo-3573351.png", "large2x": "https://images.pexels.com/photos/3573351/pexels-photo-3573351.png?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", "large": "https://images.pexels.com/photos/3573351/pexels-photo-3573351.png?auto=compress&cs=tinysrgb&h=650&w=940", "medium": "https://images.pexels.com/photos/3573351/pexels-photo-3573351.png?auto=compress&cs=tinysrgb&h=350", "small": "https://images.pexels.com/photos/3573351/pexels-photo-3573351.png?auto=compress&cs=tinysrgb&h=130", "portrait": "https://images.pexels.com/photos/3573351/pexels-photo-3573351.png?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", "landscape": "https://images.pexels.com/photos/3573351/pexels-photo-3573351.png?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", "tiny": "https://images.pexels.com/photos/3573351/pexels-photo-3573351.png?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" }, "liked": false, "alt": "Brown Rocks During Golden Hour" } ], "next_page": "https://api.pexels.com/v1/search/?page=2&per_page=1&query=nature" } |
GET https://api.pexels.com/v1/curated
Slutpunktet giver dig mulighed for at modtage fotos, som Pexels-teamet organiserer, i realtid.
Vi føjer mindst ét nyt foto til vores organiserede liste i timen – på denne måde kan du altid finde et skiftende udvalg af populære fotos.
integer | optional
The page number you are requesting. Default: 1
integer | optional
The number of results you are requesting per page. Default: 15
Max: 80
array of Photo
An array of Photo
objects.
integer
The current page number.
integer
The number of results returned with each page.
integer
The total number of results for the request.
string | optional
URL for the previous page of results, if applicable.
string | optional
URL for the next page of results, if applicable.
1 2 | curl -H "Authorization: YOUR_API_KEY" \ "https://api.pexels.com/v1/curated?per_page=1" |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | { "page": 1, "per_page": 1, "photos": [ { "id": 2880507, "width": 4000, "height": 6000, "url": "https://www.pexels.com/photo/woman-in-white-long-sleeved-top-and-skirt-standing-on-field-2880507/", "photographer": "Deden Dicky Ramdhani", "photographer_url": "https://www.pexels.com/@drdeden88", "photographer_id": 1378810, "avg_color": "#7E7F7B", "src": { "original": "https://images.pexels.com/photos/2880507/pexels-photo-2880507.jpeg", "large2x": "https://images.pexels.com/photos/2880507/pexels-photo-2880507.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", "large": "https://images.pexels.com/photos/2880507/pexels-photo-2880507.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", "medium": "https://images.pexels.com/photos/2880507/pexels-photo-2880507.jpeg?auto=compress&cs=tinysrgb&h=350", "small": "https://images.pexels.com/photos/2880507/pexels-photo-2880507.jpeg?auto=compress&cs=tinysrgb&h=130", "portrait": "https://images.pexels.com/photos/2880507/pexels-photo-2880507.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", "landscape": "https://images.pexels.com/photos/2880507/pexels-photo-2880507.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", "tiny": "https://images.pexels.com/photos/2880507/pexels-photo-2880507.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" }, "liked": false, "alt": "Brown Rocks During Golden Hour" } ], "next_page": "https://api.pexels.com/v1/curated/?page=2&per_page=1" } |
GET https://api.pexels.com/v1/photos/:id
Hent et specifikt Photo
fra dets id.
integer | required
The id of the photo you are requesting.
Returns a Photo
object
1 2 | curl -H "Authorization: YOUR_API_KEY" \ "https://api.pexels.com/v1/photos/2014422" |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | { "id": 2014422, "width": 3024, "height": 3024, "url": "https://www.pexels.com/photo/brown-rocks-during-golden-hour-2014422/", "photographer": "Joey Farina", "photographer_url": "https://www.pexels.com/@joey", "photographer_id": 680589, "avg_color": "#978E82", "src": { "original": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg", "large2x": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", "large": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", "medium": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&h=350", "small": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&h=130", "portrait": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", "landscape": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", "tiny": "https://images.pexels.com/photos/2014422/pexels-photo-2014422.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" }, "liked": false, "alt": "Brown Rocks During Golden Hour" } |
Ressourcen Video
er en JSON-formateret version af en Pexels-video. Slutpunktet for API'en til videoer svarer med videodata, der er formateret på denne måde.
integer
The id of the video.
integer
The real width of the video in pixels.
integer
The real height of the video in pixels.
string
The Pexels URL where the video is located.
string
URL to a screenshot of the video.
integer
The duration of the video in seconds.
object
The videographer who shot the video.
Array of objects
An array of different sized versions of the video.
Array of objects
An array of preview pictures of the video.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | { "id": 2499611, "width": 1080, "height": 1920, "url": "https://www.pexels.com/video/2499611/", "image": "https://images.pexels.com/videos/2499611/free-video-2499611.jpg?fit=crop&w=1200&h=630&auto=compress&cs=tinysrgb", "full_res": null, "tags": [], "duration": 22, "user": { "id": 680589, "name": "Joey Farina", "url": "https://www.pexels.com/@joey" }, "video_files": [ { "id": 125004, "quality": "hd", "file_type": "video/mp4", "width": 1080, "height": 1920, "fps": 23.976, "link": "https://player.vimeo.com/external/342571552.hd.mp4?s=6aa6f164de3812abadff3dde86d19f7a074a8a66&profile_id=175&oauth2_token_id=57447761" }, { "id": 125005, "quality": "sd", "file_type": "video/mp4", "width": 540, "height": 960, "fps": 23.976, "link": "https://player.vimeo.com/external/342571552.sd.mp4?s=e0df43853c25598dfd0ec4d3f413bce1e002deef&profile_id=165&oauth2_token_id=57447761" }, { "id": 125006, "quality": "sd", "file_type": "video/mp4", "width": 240, "height": 426, "fps": 23.976, "link": "https://player.vimeo.com/external/342571552.sd.mp4?s=e0df43853c25598dfd0ec4d3f413bce1e002deef&profile_id=139&oauth2_token_id=57447761" } ... ], "video_pictures": [ { "id": 308178, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-0.jpg", "nr": 0 }, { "id": 308179, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-1.jpg", "nr": 1 }, { "id": 308180, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-2.jpg", "nr": 2 }, { "id": 308181, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-3.jpg", "nr": 3 } ... ] } |
GET https://api.pexels.com/videos/search
Dette slutpunkt giver dig mulighed for at søge på Pexels efter alle de emner, du vil. Din forespørgsel kan f.eks. være bred såsom Natur
, Tigere
, Mennesker
. Men den kan også være mere specifik, såsom Grupper af mennesker, der arbejder
.
string | required
The search query. Ocean
, Tigers
, Pears
, etc.
string | optional
Desired video orientation. The current supported orientations are: landscape
, portrait
or square
.
string | optional
Minimum video size. The current supported sizes are: large
(4K), medium
(Full HD) or small
(HD).
string | optional
The locale of the search you are performing. The current supported locales are: 'en-US'
'pt-BR'
'es-ES'
'ca-ES'
'de-DE'
'it-IT'
'fr-FR'
'sv-SE'
'id-ID'
'pl-PL'
'ja-JP'
'zh-TW'
'zh-CN'
'ko-KR'
'th-TH'
'nl-NL'
'hu-HU'
'vi-VN'
'cs-CZ'
'da-DK'
'fi-FI'
'uk-UA'
'el-GR'
'ro-RO'
'nb-NO'
'sk-SK'
'tr-TR'
'ru-RU'
.
integer | optional
The page number you are requesting. Default: 1
integer | optional
The number of results you are requesting per page. Default: 15
Max: 80
array of Video
An array of Video
objects.
string
The Pexels URL for the current search query.
integer
The current page number.
integer
The number of results returned with each page.
integer
The total number of results for the request.
string | optional
URL for the previous page of results, if applicable.
string | optional
URL for the next page of results, if applicable.
1 2 | curl -H "Authorization: YOUR_API_KEY" \ "https://api.pexels.com/videos/search?query=nature&per_page=1" |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | { "page": 1, "per_page": 1, "total_results": 20475, "url": "https://www.pexels.com/videos/", "videos": [ { "id": 1448735, "width": 4096, "height": 2160, "url": "https://www.pexels.com/video/video-of-forest-1448735/", "image": "https://images.pexels.com/videos/1448735/free-video-1448735.jpg?fit=crop&w=1200&h=630&auto=compress&cs=tinysrgb", "duration": 32, "user": { "id": 574687, "name": "Ruvim Miksanskiy", "url": "https://www.pexels.com/@digitech" }, "video_files": [ { "id": 58649, "quality": "sd", "file_type": "video/mp4", "width": 640, "height": 338, "link": "https://player.vimeo.com/external/291648067.sd.mp4?s=7f9ee1f8ec1e5376027e4a6d1d05d5738b2fbb29&profile_id=164&oauth2_token_id=57447761" }, { "id": 58650, "quality": "hd", "file_type": "video/mp4", "width": 2048, "height": 1080, "link": "https://player.vimeo.com/external/291648067.hd.mp4?s=94998971682c6a3267e4cbd19d16a7b6c720f345&profile_id=175&oauth2_token_id=57447761" }, { "id": 58651, "quality": "hd", "file_type": "video/mp4", "width": 4096, "height": 2160, "link": "https://player.vimeo.com/external/291648067.hd.mp4?s=94998971682c6a3267e4cbd19d16a7b6c720f345&profile_id=172&oauth2_token_id=57447761" }, { "id": 58652, "quality": "hd", "file_type": "video/mp4", "width": 1366, "height": 720, "link": "https://player.vimeo.com/external/291648067.hd.mp4?s=94998971682c6a3267e4cbd19d16a7b6c720f345&profile_id=174&oauth2_token_id=57447761" }, { "id": 58653, "quality": "hd", "file_type": "video/mp4", "width": 2732, "height": 1440, "link": "https://player.vimeo.com/external/291648067.hd.mp4?s=94998971682c6a3267e4cbd19d16a7b6c720f345&profile_id=170&oauth2_token_id=57447761" }, { "id": 58654, "quality": "sd", "file_type": "video/mp4", "width": 960, "height": 506, "link": "https://player.vimeo.com/external/291648067.sd.mp4?s=7f9ee1f8ec1e5376027e4a6d1d05d5738b2fbb29&profile_id=165&oauth2_token_id=57447761" }, { "id": 58655, "quality": "hls", "file_type": "video/mp4", "width": null, "height": null, "link": "https://player.vimeo.com/external/291648067.m3u8?s=1210fac9d80f9b74b4a334c4fca327cde08886b2&oauth2_token_id=57447761" } ], "video_pictures": [ { "id": 133236, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-0.jpg", "nr": 0 }, { "id": 133237, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-1.jpg", "nr": 1 }, { "id": 133238, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-2.jpg", "nr": 2 }, { "id": 133239, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-3.jpg", "nr": 3 }, { "id": 133240, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-4.jpg", "nr": 4 }, { "id": 133241, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-5.jpg", "nr": 5 }, { "id": 133242, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-6.jpg", "nr": 6 }, { "id": 133243, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-7.jpg", "nr": 7 }, { "id": 133244, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-8.jpg", "nr": 8 }, { "id": 133245, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-9.jpg", "nr": 9 }, { "id": 133246, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-10.jpg", "nr": 10 }, { "id": 133247, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-11.jpg", "nr": 11 }, { "id": 133248, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-12.jpg", "nr": 12 }, { "id": 133249, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-13.jpg", "nr": 13 }, { "id": 133250, "picture": "https://static-videos.pexels.com/videos/1448735/pictures/preview-14.jpg", "nr": 14 } ] } ] } |
GET https://api.pexels.com/videos/popular
Slutpunktet giver dig mulighed for at hente de Pexels-videoer, der er mest populære lige nu.
integer | optional
The minimum width in pixels of the returned videos.
integer | optional
The minimum height in pixels of the returned videos.
integer | optional
The minimum duration in seconds of the returned videos.
integer | optional
The maximum duration in seconds of the returned videos.
integer | optional
The page number you are requesting. Default: 1
integer | optional
The number of results you are requesting per page. Default: 15
Max: 80
array of Video
An array of Video
objects.
string
The Pexels URL for the current page.
integer
The current page number.
integer
The number of results returned with each page.
integer
The total number of results for the request.
string | optional
URL for the previous page of results, if applicable.
string | optional
URL for the next page of results, if applicable.
1 2 | curl -H "Authorization: YOUR_API_KEY" \ "https://api.pexels.com/videos/popular?per_page=1" |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | { "page": 1, "per_page": 1, "total_results": 4089, "url": "https://www.pexels.com/search/videos/Nature/", "videos": [ { "id": 1093662, "width": 1920, "height": 1080, "url": "https://www.pexels.com/video/water-crashing-over-the-rocks-1093662/", "image": "https://images.pexels.com/videos/1093662/free-video-1093662.jpg?fit=crop&w=1200&h=630&auto=compress&cs=tinysrgb", "duration": 8, "user": { "id": 417939, "name": "Peter Fowler", "url": "https://www.pexels.com/@peter-fowler-417939" }, "video_files": [ { "id": 37101, "quality": "hd", "file_type": "video/mp4", "width": 1280, "height": 720, "link": "https://player.vimeo.com/external/269971860.hd.mp4?s=eae965838585cc8342bb5d5253d06a52b2415570&profile_id=174&oauth2_token_id=57447761" }, { "id": 37102, "quality": "sd", "file_type": "video/mp4", "width": 640, "height": 360, "link": "https://player.vimeo.com/external/269971860.sd.mp4?s=a3036bd1a9f15c1b31daedad98c06a3b24cdd747&profile_id=164&oauth2_token_id=57447761" }, { "id": 37103, "quality": "hd", "file_type": "video/mp4", "width": 1920, "height": 1080, "link": "https://player.vimeo.com/external/269971860.hd.mp4?s=eae965838585cc8342bb5d5253d06a52b2415570&profile_id=175&oauth2_token_id=57447761" }, { "id": 37104, "quality": "sd", "file_type": "video/mp4", "width": 960, "height": 540, "link": "https://player.vimeo.com/external/269971860.sd.mp4?s=a3036bd1a9f15c1b31daedad98c06a3b24cdd747&profile_id=165&oauth2_token_id=57447761" }, { "id": 37105, "quality": "hls", "file_type": "video/mp4", "width": null, "height": null, "link": "https://player.vimeo.com/external/269971860.m3u8?s=ac08929c597387cc77ae3d88bfe2ad66a9c4d31f&oauth2_token_id=57447761" } ], "video_pictures": [ { "id": 79696, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-0.jpg", "nr": 0 }, { "id": 79697, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-1.jpg", "nr": 1 }, { "id": 79698, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-2.jpg", "nr": 2 }, { "id": 79699, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-3.jpg", "nr": 3 }, { "id": 79700, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-4.jpg", "nr": 4 }, { "id": 79701, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-5.jpg", "nr": 5 }, { "id": 79702, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-6.jpg", "nr": 6 }, { "id": 79703, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-7.jpg", "nr": 7 }, { "id": 79704, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-8.jpg", "nr": 8 }, { "id": 79705, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-9.jpg", "nr": 9 }, { "id": 79706, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-10.jpg", "nr": 10 }, { "id": 79707, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-11.jpg", "nr": 11 }, { "id": 79708, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-12.jpg", "nr": 12 }, { "id": 79709, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-13.jpg", "nr": 13 }, { "id": 79710, "picture": "https://static-videos.pexels.com/videos/1093662/pictures/preview-14.jpg", "nr": 14 } ] } ] } |
GET https://api.pexels.com/videos/videos/:id
Hent et specifikt Video
fra dets id.
integer | required
The id of the video you are requesting.
Returns a Video
object
1 2 | curl -H "Authorization: YOUR_API_KEY" \ "https://api.pexels.com/videos/videos/2499611" |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | { "id": 2499611, "width": 1080, "height": 1920, "url": "https://www.pexels.com/video/2499611/", "image": "https://images.pexels.com/videos/2499611/free-video-2499611.jpg?fit=crop&w=1200&h=630&auto=compress&cs=tinysrgb", "duration": 22, "user": { "id": 680589, "name": "Joey Farina", "url": "https://www.pexels.com/@joey" }, "video_files": [ { "id": 125004, "quality": "hd", "file_type": "video/mp4", "width": 1080, "height": 1920, "link": "https://player.vimeo.com/external/342571552.hd.mp4?s=6aa6f164de3812abadff3dde86d19f7a074a8a66&profile_id=175&oauth2_token_id=57447761" }, { "id": 125005, "quality": "sd", "file_type": "video/mp4", "width": 540, "height": 960, "link": "https://player.vimeo.com/external/342571552.sd.mp4?s=e0df43853c25598dfd0ec4d3f413bce1e002deef&profile_id=165&oauth2_token_id=57447761" }, { "id": 125006, "quality": "sd", "file_type": "video/mp4", "width": 240, "height": 426, "link": "https://player.vimeo.com/external/342571552.sd.mp4?s=e0df43853c25598dfd0ec4d3f413bce1e002deef&profile_id=139&oauth2_token_id=57447761" }, { "id": 125007, "quality": "hd", "file_type": "video/mp4", "width": 720, "height": 1280, "link": "https://player.vimeo.com/external/342571552.hd.mp4?s=6aa6f164de3812abadff3dde86d19f7a074a8a66&profile_id=174&oauth2_token_id=57447761" }, { "id": 125008, "quality": "sd", "file_type": "video/mp4", "width": 360, "height": 640, "link": "https://player.vimeo.com/external/342571552.sd.mp4?s=e0df43853c25598dfd0ec4d3f413bce1e002deef&profile_id=164&oauth2_token_id=57447761" }, { "id": 125009, "quality": "hls", "file_type": "video/mp4", "width": null, "height": null, "link": "https://player.vimeo.com/external/342571552.m3u8?s=53433233e4176eead03ddd6fea04d9fb2bce6637&oauth2_token_id=57447761" } ], "video_pictures": [ { "id": 308178, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-0.jpg", "nr": 0 }, { "id": 308179, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-1.jpg", "nr": 1 }, { "id": 308180, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-2.jpg", "nr": 2 }, { "id": 308181, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-3.jpg", "nr": 3 }, { "id": 308182, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-4.jpg", "nr": 4 }, { "id": 308183, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-5.jpg", "nr": 5 }, { "id": 308184, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-6.jpg", "nr": 6 }, { "id": 308185, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-7.jpg", "nr": 7 }, { "id": 308186, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-8.jpg", "nr": 8 }, { "id": 308187, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-9.jpg", "nr": 9 }, { "id": 308188, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-10.jpg", "nr": 10 }, { "id": 308189, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-11.jpg", "nr": 11 }, { "id": 308190, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-12.jpg", "nr": 12 }, { "id": 308191, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-13.jpg", "nr": 13 }, { "id": 308192, "picture": "https://static-videos.pexels.com/videos/2499611/pictures/preview-14.jpg", "nr": 14 } ] } |
Pexels-samlinger er en måde at gruppere specifikke fotos og videoer i ét samlet galleri. Dette kan være nyttigt, hvis du f.eks. vil vise en specifik undergruppe af Pexels-indhold til dine brugere. Du kan få adgang til alle dine samlinger og medierne i dem via Pexels API'en.
Bemærk: Samlinger kan ikke oprettes eller redigeres ved hjælp af Pexels API'en. Du kan i stedet administrere dine samlinger via Pexels websted eller app til iOS eller Android. API giver dig kun adgang til udvalgte funktioner og dine egne samlinger.
Ressourcen Collection
er en JSON-formateret version af en Pexels-samling. Samlingslistens slutpunkt svarer med de samlingsdata, der er formateret på denne måde.
string
The id of the collection.
string
The name of the collection.
string
The description of the collection.
boolean
Whether or not the collection is marked as private.
integer
The total number of media included in this collection.
integer
The total number of photos included in this collection.
integer
The total number of videos included in this collection.
1 2 3 4 5 6 7 8 9 | { "id": "8xntbhr", "title": "Hello Spring", "description": "Baby chicks, rabbits & pretty flowers. What's not to love?", "private": false, "media_count": 130, "photos_count": 121, "videos_count": 9 } |
GET https://api.pexels.com/v1/collections/featured
Dette slutpunkt returnerer alle udvalgte samlinger på Pexels.
integer | optional
The page number you are requesting. Default: 1
integer | optional
The number of results you are requesting per page. Default: 15
Max: 80
array of Collection
An array of Collection
objects.
integer
The current page number.
integer
The number of results returned with each page.
integer
The total number of results for the request.
string | optional
URL for the previous page of results, if applicable.
string | optional
URL for the next page of results, if applicable.
1 2 | curl -H "Authorization: YOUR_API_KEY" \ "https://api.pexels.com/v1/collections/featured?per_page=1" |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | { "collections": [ { "id": "9mp14cx", "title": "Cool Cats", "description": null, "private": false, "media_count": 6, "photos_count": 5, "videos_count": 1 } ], "page": 2, "per_page": 1, "total_results": 5, "next_page": "https://api.pexels.com/v1/collections/featured/?page=3&per_page=1", "prev_page": "https://api.pexels.com/v1/collections/featured?page=1&per_page=1" } |
GET https://api.pexels.com/v1/collections
Dette slutpunkt returnerer alle dine samlinger.
integer | optional
The page number you are requesting. Default: 1
integer | optional
The number of results you are requesting per page. Default: 15
Max: 80
array of Collection
An array of Collection
objects.
integer
The current page number.
integer
The number of results returned with each page.
integer
The total number of results for the request.
string | optional
URL for the previous page of results, if applicable.
string | optional
URL for the next page of results, if applicable.
1 2 | curl -H "Authorization: YOUR_API_KEY" \ "https://api.pexels.com/v1/collections?per_page=1" |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | { "collections": [ { "id": "9mp14cx", "title": "Cool Cats", "description": null, "private": false, "media_count": 6, "photos_count": 5, "videos_count": 1 } ], "page": 2, "per_page": 1, "total_results": 5, "next_page": "https://api.pexels.com/v1/collections/?page=3&per_page=1", "prev_page": "https://api.pexels.com/v1/collections/?page=1&per_page=1" } |
GET https://api.pexels.com/v1/collections/:id
Dette slutpunkt returnerer alle de medier (fotos og videoer), der findes i en enkelt samling. Du kan filtrere listen, så du kun modtager fotos eller videoer ved hjælp af parameteren type
.
string | optional
The type of media you are requesting. If not given or if given with an invalid value, all media will be returned. Supported values are photos
and videos
.
string | optional
The order of items in the media collection. Supported values are: asc
, desc
. Default: asc
integer | optional
The page number you are requesting. Default: 1
integer | optional
The number of results you are requesting per page. Default: 15
Max: 80
string
The id of the collection you are requesting.
array of Photo
or Video
objects.
An array of media objects. Each object has an extra type
attribute to indicate the type of object.
integer
The current page number.
integer
The number of results returned with each page.
integer
The total number of results for the request.
string | optional
URL for the previous page of results, if applicable.
string | optional
URL for the next page of results, if applicable.
1 2 | curl -H "Authorization: YOUR_API_KEY" \ "https://api.pexels.com/v1/collections/9mp14cx?per_page=1&sort=desc" |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | { "id": "9mp14cx", "media": [ { "type": "Photo", "id": 2061057, "width": 4850, "height": 3224, "url": "https://www.pexels.com/photo/gray-and-white-kitten-on-white-bed-2061057/", "photographer": "Tranmautritam", "photographer_url": "https://www.pexels.com/@tranmautritam", "photographer_id": 8509, "avg_color": "#BBBEC3", "src": { "original": "https://images.pexels.com/photos/2061057/pexels-photo-2061057.jpeg", "large2x": "https://images.pexels.com/photos/2061057/pexels-photo-2061057.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940", "large": "https://images.pexels.com/photos/2061057/pexels-photo-2061057.jpeg?auto=compress&cs=tinysrgb&h=650&w=940", "medium": "https://images.pexels.com/photos/2061057/pexels-photo-2061057.jpeg?auto=compress&cs=tinysrgb&h=350", "small": "https://images.pexels.com/photos/2061057/pexels-photo-2061057.jpeg?auto=compress&cs=tinysrgb&h=130", "portrait": "https://images.pexels.com/photos/2061057/pexels-photo-2061057.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=1200&w=800", "landscape": "https://images.pexels.com/photos/2061057/pexels-photo-2061057.jpeg?auto=compress&cs=tinysrgb&fit=crop&h=627&w=1200", "tiny": "https://images.pexels.com/photos/2061057/pexels-photo-2061057.jpeg?auto=compress&cs=tinysrgb&dpr=1&fit=crop&h=200&w=280" }, "liked": false }, { "type": "Video", "id": 854982, "width": 1280, "height": 720, "duration": 11, "full_res": null, "tags": [], "url": "https://www.pexels.com/video/video-of-a-tabby-cat-854982/", "image": "https://images.pexels.com/videos/854982/free-video-854982.jpg?auto=compress&cs=tinysrgb&fit=crop&h=630&w=1200", "avg_color": null, "user": { "id": 2659, "name": "Pixabay", "url": "https://www.pexels.com/@pixabay" }, "video_files": [ { "id": 17755, "quality": "hd", "file_type": "video/mp4", "width": 1280, "height": 720, "link": "https://player.vimeo.com/external/199433617.hd.mp4?s=1770018c20604d41d60e4f574e7680a1bd15edb8&profile_id=174&oauth2_token_id=57447761" }, { "id": 17756, "quality": "sd", "file_type": "video/mp4", "width": 640, "height": 360, "link": "https://player.vimeo.com/external/199433617.sd.mp4?s=457abd2452a52548b8c02c503a91035ce8a713f0&profile_id=164&oauth2_token_id=57447761" }, { "id": 17757, "quality": "sd", "file_type": "video/mp4", "width": 960, "height": 540, "link": "https://player.vimeo.com/external/199433617.sd.mp4?s=457abd2452a52548b8c02c503a91035ce8a713f0&profile_id=165&oauth2_token_id=57447761" }, { "id": 17758, "quality": "hls", "file_type": "video/mp4", "width": null, "height": null, "link": "https://player.vimeo.com/external/199433617.m3u8?s=115ec8875069ea6203ddca51dae78cebd934b86e&oauth2_token_id=57447761" } ], "video_pictures": [ { "id": 19591, "nr": 0, "picture": "https://images.pexels.com/videos/854982/pictures/preview-0.jpg" }, { "id": 19592, "nr": 1, "picture": "https://images.pexels.com/videos/854982/pictures/preview-1.jpg" }, { "id": 19593, "nr": 2, "picture": "https://images.pexels.com/videos/854982/pictures/preview-2.jpg" }, { "id": 19594, "nr": 3, "picture": "https://images.pexels.com/videos/854982/pictures/preview-3.jpg" }, { "id": 19595, "nr": 4, "picture": "https://images.pexels.com/videos/854982/pictures/preview-4.jpg" }, { "id": 19596, "nr": 5, "picture": "https://images.pexels.com/videos/854982/pictures/preview-5.jpg" }, { "id": 19597, "nr": 6, "picture": "https://images.pexels.com/videos/854982/pictures/preview-6.jpg" }, { "id": 19598, "nr": 7, "picture": "https://images.pexels.com/videos/854982/pictures/preview-7.jpg" }, { "id": 19599, "nr": 8, "picture": "https://images.pexels.com/videos/854982/pictures/preview-8.jpg" }, { "id": 19600, "nr": 9, "picture": "https://images.pexels.com/videos/854982/pictures/preview-9.jpg" }, { "id": 19601, "nr": 10, "picture": "https://images.pexels.com/videos/854982/pictures/preview-10.jpg" }, { "id": 19602, "nr": 11, "picture": "https://images.pexels.com/videos/854982/pictures/preview-11.jpg" }, { "id": 19603, "nr": 12, "picture": "https://images.pexels.com/videos/854982/pictures/preview-12.jpg" }, { "id": 19604, "nr": 13, "picture": "https://images.pexels.com/videos/854982/pictures/preview-13.jpg" }, { "id": 19605, "nr": 14, "picture": "https://images.pexels.com/videos/854982/pictures/preview-14.jpg" } ] } ], "page": 2, "per_page": 2, "total_results": 6, "next_page": "https://api.pexels.com/v1/collections/9mp14cx/?page=3&per_page=2", "prev_page": "https://api.pexels.com/v1/collections/9mp14cx/?page=1&per_page=2" } |
Dette er en liste over store ændringer af Pexels API'en.
sort
query parameter to the /collections/:id
endpoint.video_file.fps
attribute for the Video
resource.alt
attribute to the Photo
resource.liked
attribute to the Photo
responses.image
attribute for the Video
resource to use the correct orientation.video_picture.picture
attribute for the Video
resource to use the correct orientation./collections/:id
. Returns a collection if the collection is featured
or belongs to the authenticated user.avg_color
attribute to the Photo resource.orientation
, size
and color
filters to Photo Search.orientation
and size
filters to Video Search.