kosa3/pexels-go is Pexels API Client for Go.
Pexels is the best free stock photos & videos shared by talented creators.
$ go get -u github.com/kosa3/pexels-go
See example directory.
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)
}
| Endpoint |
HTTP Method |
| /v1/search |
GET |
| /v1/curated |
GET |
| /v1/photos/{id} |
GET |
| Endpoint |
HTTP Method |
| /videos/search |
GET |
| /videos/popular |
GET |
| /videos/videos/{id} |
GET |
| Endpoint |
HTTP Method |
| /v1/collections/featured |
GET |
| /v1/collections |
GET |
| /v1/collections/{id} |
GET |