{"id":29921418,"url":"https://github.com/iwatkot/pypexel","last_synced_at":"2025-08-02T07:45:14.668Z","repository":{"id":303857734,"uuid":"1016964570","full_name":"iwatkot/pypexel","owner":"iwatkot","description":"Async Object-oriented Python SDK for the Pexels API.","archived":false,"fork":false,"pushed_at":"2025-07-10T00:43:00.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-10T04:27:29.047Z","etag":null,"topics":["api","async","pexels","pexels-api","pexels-downloader","photos","videos"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iwatkot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"iwatkot","thanks_dev":null,"custom":null}},"created_at":"2025-07-09T20:04:40.000Z","updated_at":"2025-07-10T00:43:03.000Z","dependencies_parsed_at":"2025-07-10T04:27:32.825Z","dependency_job_id":"fc0d01e9-15de-418a-a645-7aaf7ad029c7","html_url":"https://github.com/iwatkot/pypexel","commit_stats":null,"previous_names":["iwatkot/pypexel"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/iwatkot/pypexel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwatkot%2Fpypexel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwatkot%2Fpypexel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwatkot%2Fpypexel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwatkot%2Fpypexel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iwatkot","download_url":"https://codeload.github.com/iwatkot/pypexel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwatkot%2Fpypexel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268348985,"owners_count":24236315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","async","pexels","pexels-api","pexels-downloader","photos","videos"],"created_at":"2025-08-02T07:45:10.065Z","updated_at":"2025-08-02T07:45:14.637Z","avatar_url":"https://github.com/iwatkot.png","language":"Python","funding_links":["https://buymeacoffee.com/iwatkot"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\" markdown\u003e\n\u003cimg src=\"https://github.com/iwatkot/pypexel/releases/download/0.0.1/poster.png\"\u003e\n\nAsync Object-oriented Python SDK for the Pexels API.\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"#Overview\"\u003eOverview\u003c/a\u003e •\n    \u003ca href=\"#Quick-Start\"\u003eQuick Start\u003c/a\u003e •\n    \u003ca href=\"#Examples\"\u003eExamples\u003c/a\u003e •\n    \u003ca href=\"#Bugs-and-Feature-Requests\"\u003eBugs and Feature Requests\u003c/a\u003e •\n    \u003ca href=\"https://pypi.org/project/pypexel/\"\u003ePyPI\u003c/a\u003e\n\u003c/p\u003e\n\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/iwatkot/pypexel)](https://github.com/iwatkot/pypexel/releases)\n[![PyPI - Version](https://img.shields.io/pypi/v/pypexel)](https://pypi.org/project/pypexel/)\n[![GitHub issues](https://img.shields.io/github/issues/iwatkot/pypexel)](https://github.com/iwatkot/pypexel/issues)\n[![Build Status](https://github.com/iwatkot/pypexel/actions/workflows/checks.yml/badge.svg)](https://github.com/iwatkot/pypexel/actions)\n[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)\u003cbr\u003e\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/pypexel)](https://pypi.org/project/pypexel/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pypexel)](https://pypi.org/project/pypexel/)\n[![codecov](https://codecov.io/github/iwatkot/pypexel/graph/badge.svg?token=M9EYR3D23P)](https://codecov.io/github/iwatkot/pypexel)\n\n\u003c/div\u003e\n\n## Overview\nThis SDK is designed to interact with the [Pexels API](https://www.pexels.com/api/) in a more object-oriented way. It provides asynchronous methods to interact with the API. The SDK is designed to be as simple as possible to use, while still providing a lot of flexibility and uses `Pydantic` models to validate the data.\u003cbr\u003e\nUsed dependencies:\n- `httpx` for asynchronous API\n- `pydantic` for models\n\nSupported Python versions:\n- 3.11\n- 3.12\n\n## Quick Start\nAfter installing the SDK, you can create a new instance of the API. When creating a new instance, you can either use environment variables or pass the credentials directly. It's strongly recommended to use environment variables to store the API credentials.\u003cbr\u003e\n\n### Installation\n```bash\npip install pypexel\n```\n\n### Create a new instance of the API\nIt's recommended to use an environment variable to store the API credentials:\n```python\nimport os\n\nos.environ[\"PEXELS_API_KEY\"] = \"your-api-key\"\n```\n\nTo work asynchronously:\n```python\nimport pypexel as pex\n\n# Using environment variables:\napi = pex.AsyncApi.from_env()\n\n# Or using the credentials directly:\napi = pex.AsyncApi(\"your-api-key\")\n```\n\n## Examples\nYou'll find detailed docs with usage examples for both APIs and for used models in the corresponding package directories:\n- [Asynchronous API](pypexel/async_api/README.md)\n- [Models](pypexel/models/README.md)\n\nIn this section, you'll find some examples of how to use the SDK. You can also check out the [demo.py](demo.py) file in the root directory for more examples.\n\n### Search for photos\n```python\nimport asyncio\nimport os\nimport pypexel as pex\n\nos.environ[\"PEXELS_API_KEY\"] = \"your-api-key\"\n\napi = pex.AsyncApi.from_env()\n\nasync def main():\n    # Search for photos with the query \"nature\"\n    photos = await api.photos.search(\"nature\", limit=10)\n    \n    # Print the first photo's URL\n    if photos:\n        print(photos[0].src.original)\n    else:\n        print(\"No photos found.\")\n\nasyncio.run(main())\n```\n\n### Search for videos\n```python\nimport asyncio\nimport os\nimport pypexel as pex\n\nos.environ[\"PEXELS_API_KEY\"] = \"your-api-key\"\napi = pex.AsyncApi.from_env()\n\nasync def main():\n    # Search for videos with the query \"nature\"\n    videos = await api.videos.search(\"nature\", limit=10)\n    \n    # Print the first video URL\n    if videos:\n        print(videos[0].video_files[0].link)\n    else:\n        print(\"No videos found.\")\n\nasyncio.run(main())\n```\n\n## Bugs and Feature Requests\nIf you find a bug or have a feature request, please open an issue on the GitHub repository.\u003cbr\u003e\nYou're also welcome to contribute to the project by opening a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwatkot%2Fpypexel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiwatkot%2Fpypexel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwatkot%2Fpypexel/lists"}