Skip to content

zacharykeeping/PexelsNet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PexelsNet

PexelsNet is a .NET class library that provides an easy-to-use interface for the Pexels API

Nuget

https://www.nuget.org/packages/PexelsNet/

Initializing

var client = new PexelsClient("<Your Api key>");

Methods

Search

The following example will grab all images for the term business using the default pagination (15 images).

var results = client.SearchAsync("business").Result; 

foreach (var image in results.Photos)
{
    Console.WriteLine(image.Src.Medium);
}

Popular

The following example will grab all popular images using the default pagination (15 images).

var results = client.PopularAsync().Result; 

foreach (var image in results.Photos)
{
    Console.WriteLine(image.Src.Medium);
}

Pagination

By default, pexels will return 15 images but you can specify your own pagination.

The following example will grab 20 images from the 2nd page for the term business.

var page = client.SearchAsync("business", 2, 20).Result; 

The following example will grab 20 popular images from the 2nd page.

var page = client.PopularAsync(2, 20).Result; 

About

PexelsNet is a .NET class library that provides an easy-to-use interface for the https://www.pexels.com/ web api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%