Welcome to Pexels.com API Python Library!
An easy library to use pexels api.
Official Documenation: https://www.pexels.com/api/documentation/ API Key: API Key can be generated from official website of Pexels.com (https://www.pexels.com/api/)
Installation
pip install pexels-api-py
Usage
Photos
Photos & Videos Parameters
query (string - required)
The search query.
Ocean,Tigers,Pears, etc.orientation (string - optional)
Desired photo orientation. The current supported orientations are:
landscape,portraitorsquare.size (string - optional)
Minimum photo size. The current supported sizes are:
large(24MP),medium(12MP) orsmall(4MP).color (string - optional)
Desired photo color. Supported colors:
red,orange,yellow,green,turquoise,blue,violet,pink,brown,black,gray,whiteor any hexidecimal color code (eg.#ffffff).locale (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'.page (integer - optional)
The page number you are requesting.
Default: 1per_page (integer - optional)
The number of results you are requesting per page.
Default: 15Max: 80
Search Photos
from pexelsapi.pexels import Pexels
pexel = Pexels('API_KEY')
search_photos = pexel.search_photos(query='ocean', orientation='', size='', color='', locale='', page=1, per_page=15)
print(search_photos)
Curated Photos
from pexelsapi.pexels import Pexels
pexel = Pexels('API_KEY')
curated_photos = pexel.curated_photos(page=1, per_page=15)
print(curated_photos)
Get Photo
from pexelsapi.pexels import Pexels
pexel = Pexels('API_KEY')
get_photo = pexel.get_photo(photo_id=10)
print(get_photo)
Videos
Search Videos
from pexelsapi.pexels import Pexels
pexel = Pexels('API_KEY')
search_videos = pexel.search_videos(query='ocean', orientation='', size='', color='', locale='', page=1, per_page=15)
print(search_videos)
Popular Videos
Parameters
min_width (integer | optional)
The minimum width in pixels of the returned videos.
min_height (integer | optional)
The minimum height in pixels of the returned videos.
min_duration (integer | optional)
The minimum duration in seconds of the returned videos.
max_duration (integer | optional)
The maximum duration in seconds of the returned videos.
page (integer | optional)
The page number you are requesting.
Default: 1per_page (integer | optional)
The number of results you are requesting per page.
Default: 15Max: 80
from pexelsapi.pexels import Pexels
pexel = Pexels('API_KEY')
popular_videos = pexel.popular_videos(min_width='', min_height='', min_duration='', max_duration='', page=1, per_page=15)
print(popular_videos)
Get Video
from pexelsapi.pexels import Pexels
pexel = Pexels('API_KEY')
get_video = pexel.get_video(video_id=10)
print(get_video)
Metadata
Release files for pexels-api-py 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pexels-api-py-0.0.5.tar.gz | 3.2 kB | Without provenance | Details |
Release files / pexels-api-py-0.0.5.tar.gz
| Download URL | pexels-api-py-0.0.5.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b46dadc89e09412d6fceafe30629c8eafaf6fee4b224ca0fa6d3123cf3e783d8
|
|
BLAKE2b-256 checksum How to use checksums |
b67b6f95e67d9629b39a4d29600bae31eb1d7d860582a6a9fddf76457573ca9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.10
|
Security for pexels-api-py 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.