Skip to content

🚢 Foursquare .NET Client that you will fall in love with ❤️

License

Notifications You must be signed in to change notification settings

tugberkugurlu/BonVoyage

Repository files navigation

BonVoyage Build Status

Foursquare .NET Client that you will fall in love with ❤️ This library supports .NET Standard 2.0.

Getting the Library

BonVoyage Foursquare .NET Client is available on NuGet and can be integrated into your project through the usual ways.

API Usage

One of the great things about BonVoyage is its semantic API. Each resource you get a handle of (e.g. Category, Venue) will expose its aspects (e.g. Photos) and actions (e.g. Like, Dislike). You can have a glimpse of the API below.

Userless Access

The simple usage of the API for userless access:

var userlessSettings = new UserlessAccessSettings("CLIENT-ID", "CLIENT-SECRET");

using (var bonVoyageContext = new BonVoyageContext())
using (var foursquareContext = bonVoyageContext.CreateUserlessFoursquareContext(userlessSettings))
{
    // Get and itirate over top level categories
    var categories = await foursquareContext.Categories.Get();
    foreach (var venueCategory in categories)
    {
        Console.WriteLine("{0}: {1}", venueCategory.Id, venueCategory.Name);

        // Let's now get venues in San Fransisco for each category
        var venues = await venueCategory.SearchVenues("San Fransisco, CA", 10);
        foreach (var venue in venues)
        {
            Console.WriteLine("\t{0}: {1}", venue.Id, venue.Name);

            // Finally, get the photos of each venue
            var photos = await venue.GetPhotos();
            foreach (var photo in photos)
            {
                Console.WriteLine("{0}: {1}", photo.GetUrl(), photo.Visibility);
            }
        }
    }
}

You can see the Playground example for some more details on the usage.