A Python wrapper for the Pexels API
Project description
Pexels API Python
A Python wrapper for the Pexels API, allowing you to search for photos, get photo details, and fetch popular photos.
Get your API KEY
Installation
You can install the library using pip:
pip install pexels_api_python
Include the below code in your main.py
from pexels_api_python.pexels_api import PexelsAPI
# Initialize the API with your API key
api_key = "API_KEY" ENTER YOUR API KEY
pexels = PexelsAPI(api_key)
# Search for photos
search_results = pexels.search_photos("mountains")
# Download the first photo from the search results
if search_results.get("photos"):
first_photo = search_results["photos"][0]
photo_url = first_photo["src"]["original"]
pexels.download_photo(photo_url, "mountains.jpg")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pexels_api_python-0.1.4.tar.gz.
File metadata
- Download URL: pexels_api_python-0.1.4.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1ab80ade0d30820e7ec53f92ddcbe006e0ea05cbcd51dd67295c07adb61d0bf
|
|
| MD5 |
51193a721c87b6694214e32b1ea8ae4a
|
|
| BLAKE2b-256 |
3811b61c342612f894f7718c949d6b7fe0487b18a6052af5213d997227cc2486
|
File details
Details for the file pexels_api_python-0.1.4-py3-none-any.whl.
File metadata
- Download URL: pexels_api_python-0.1.4-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4861be2d3ac20212d4a30414dba92b6652ab7eaebf12e994c218e4066414e829
|
|
| MD5 |
5d3ef90250b66c6751f1ffb299277993
|
|
| BLAKE2b-256 |
093090889d72b938093079553551ef83bcba07cd9ec620e862e0bf68d6edc100
|