Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

mathieukempe/PexelsNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

38 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

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /