An open API service indexing awesome lists of open source software.

https://github.com/openpeeps/pexels-nim

Nim library for the Pexels API
https://github.com/openpeeps/pexels-nim

api-client nim-clients nim-language openpeeps pexels

Last synced: 4 months ago
JSON representation

Nim library for the Pexels API

Awesome Lists containing this project

README

          




👑 Nim library for the Pexels API


nimble install pexels


API reference

Github Actions Github Actions

## 😍 Key Features
- [x] Search Pexels for photos & videos
- [x] Direct to Object parser
- [x] Written in Nim language

First, create your API key: https://www.pexels.com/api/

## Examples
**Search for Photos**

Search Pexels for any topic that you would like.

```nim
import pkg/pexels

let
px: Pexels = newPexelsClient(apikey = "123abc")
pics: PexelsPhotosResponse =
waitFor px.search("cat", perPage = 5)
for pic in pics:
echo pic.src.tiny
```

**Search for Videos**
```nim
import pkg/pexels
let
px = newPexelsClient(apikey = "123abc")
vids: PexelsVideosResponse =
waitFor px.videos("nature")
for vid in vids:
echo vid
```

### ❤ Contributions & Support
- 🐛 Found a bug? [Create a new Issue](/issues)
- 👋 Wanna help? [Fork it!](/fork)
- 😎 [Get €20 in cloud credits from Hetzner](https://hetzner.cloud/?ref=Hm0mYGM9NxZ4)

### 🎩 License
Pexels for Nim language | MIT license. [Made by Humans from OpenPeeps](https://github.com/openpeeps).

Copyright © OpenPeeps & Contributors — All rights reserved.