Using Pexels API v1 with Python
Use pexels_api to search photos from Pexels.
Dependencies:
Installation:
pip install pexels-api
Usage:
The following code shows you how to import the package and make a simple query to Pexels API v1. See more examples or the documentation.
# Import API class from pexels_api package
from pexels_api import API
# Type your Pexels API
PEXELS_API_KEY = 'YOUR-PEXELS-API-KEY'
# Create API object
api = API(PEXELS_API_KEY)
# Search five 'kitten' photos
api.search('kitten', page=1, results_per_page=5)
# Get photo entries
photos = api.get_entries()
# Loop the five photos
for photo in photos:
# Print photographer
print('Photographer: ', photo.photographer)
# Print url
print('Photo url: ', photo.url)
# Print original size url
print('Photo original size: ', photo.original)
Metadata
Release files for pexels-api 1.0.1
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-1.0.1.tar.gz | 3.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pexels_api-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.8 kB
Release files / pexels-api-1.0.1.tar.gz
| Download URL | pexels-api-1.0.1.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89934dbe0e37481234c5659883be0958de0f809740b9874b9d2caaa974f9d0bf
|
|
BLAKE2b-256 checksum How to use checksums |
c4764dbb76437cdf33607e220b1338ef27b2a883c0d431abccd72a4f5c62575a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
|
Release files / pexels_api-1.0.1-py3-none-any.whl
| Download URL | pexels_api-1.0.1-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3923eab214e6469a9b9fc6bc5a2d692e206a5c45f9f82b4ce1a685508057037e
|
|
BLAKE2b-256 checksum How to use checksums |
55ed46df816965f51e45d26197df4dc89c4f7d0b4ae4223ceb9ca4712f5a79e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
|
Security for pexels-api 1.0.1
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.