https://github.com/kosa3/pexels-go
Pexels API Client for Go
https://github.com/kosa3/pexels-go
pexels pexels-api
Last synced: 6 months ago
JSON representation
Pexels API Client for Go
- Host: GitHub
- URL: https://github.com/kosa3/pexels-go
- Owner: kosa3
- License: mit
- Created: 2021-09-22T13:31:19.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T08:02:48.000Z (over 1 year ago)
- Last Synced: 2024-10-28T09:29:52.113Z (over 1 year ago)
- Topics: pexels, pexels-api
- Language: Go
- Homepage:
- Size: 28.3 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pexels API Client for Go
`kosa3/pexels-go` is [Pexels API](https://www.pexels.com/api/documentation/) Client for Go.
[Pexels](https://www.pexels.com/) is the best free stock photos & videos shared by talented creators.
## Install
```
$ go get -u github.com/kosa3/pexels-go
```
## Examples
See [example](_example) directory.
```go
func main() {
cli := pexels.NewClient(os.Args[1])
ctx := context.Background()
ps, err := cli.PhotoService.Search(ctx, &pexels.PhotoParams{
Query: "people",
Page: 2,
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Source Medium URL:", ps.Photos[0].Src.Medium)
}
```
## Supported API
### Photo
| Endpoint | HTTP Method |
|-----------------------------------------|:-----------:|
|/v1/search | GET |
|/v1/curated | GET |
|/v1/photos/{id} | GET |
### Video
| Endpoint | HTTP Method |
|-----------------------------------------|:-----------:|
|/videos/search | GET |
|/videos/popular | GET |
|/videos/videos/{id} | GET |
### Collection
| Endpoint | HTTP Method |
|-----------------------------------------|:-----------:|
|/v1/collections/featured | GET |
|/v1/collections | GET |
|/v1/collections/{id} | GET |