4 releases

new 0.0.4 Jan 8, 2025
0.0.3 Jan 3, 2025
0.0.2 Jan 1, 2025
0.0.1 Dec 31, 2024

#117 in Asynchronous

Download history 416/week @ 2024-12-31

416 downloads per month

MIT/Apache

90KB
1.5K SLoC

Pexels CLI

Pexels CLI is a command-line interface for interacting with the Pexels API. It allows you to search for photos, videos, and collections, as well as retrieve individual media items by their ID.

Installation

  1. Clone the repository:

    git clone https://github.com/houseme/pexels.git
    
  2. Navigate to the project directory:

    cd pexels/pexels-cli
    
  3. Build the project:

    cargo build
    

Usage

Before using the CLI, make sure to set your Pexels API key in a .env file:

PEXELS_API_KEY=your_api_key_here

Commands

  • Search Photos:

    cargo run -- search-photos --query "nature" --per-page 10 --page 1
    
  • Search Videos:

    cargo run -- search-videos --query "nature" --per-page 10 --page 1
    
  • Get Photo by ID:

    cargo run -- get-photo --id 12345
    
  • Get Video by ID:

    cargo run -- get-video --id 12345
    
  • Search Collections:

    cargo run -- search-collections --per-page 10 --page 1
    
  • Search Media:

    cargo run -- search-media --query "nature" --per-page 10 --page 1 --type "photo" --sort "latest"
    

Documentation

For detailed documentation, please refer to Documentation.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 or MIT license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~8–19MB
~254K SLoC