Before starting...
Obtain a key from https://www.pexels.com/api by selecting 'Get Started'. View full API documentation here https://www.pexels.com/api/documentation.
Install this via nuget: https://www.nuget.org/packages/PexelsDotNetSDK/.
var pexelsClient = new PexelsClient("[YOUR_API_KEY]");
var result = await pexelsClient.SearchPhotosAsync("nature");
var result = await pexelsClient.CuratedPhotosAsync();
var result = await pexelsClient.GetPhotoAsync(2014422);
var result = await pexelsClient.SearchVideosAsync("nature");
var result = await pexelsClient.PopularVideosAsync();
var result = await pexelsClient.GetVideoAsync(2499611);
Note: this is limited to collections belonging to the API user.
var result = await pexelsClient.CollectionsAsync();
var result = await pexelsClient.FeaturedCollectionsAsync();
var result = await pexelsClient.GetCollectionAsync("[your collection id]");
You can also filter by type
i.e. photos
or videos
:
var result = await pexelsClient.GetCollectionAsync(id: "[your collection id]", type: "photos");