RideWithGPS 2.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package RideWithGPS --version 2.0.2                
NuGet\Install-Package RideWithGPS -Version 2.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RideWithGPS" Version="2.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RideWithGPS --version 2.0.2                
#r "nuget: RideWithGPS, 2.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RideWithGPS as a Cake Addin
#addin nuget:?package=RideWithGPS&version=2.0.2

// Install RideWithGPS as a Cake Tool
#tool nuget:?package=RideWithGPS&version=2.0.2                

RideWithGPS

This is a very simple wrapper to the RideWithGPS API. I did not encasulate all of the functionality of the API and some of the fields may not be mapped to the correct data types, but would love to get contributions from others!

This client library is published on nuget.org below,

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

Registering with RideWithGPS's API

You need to register with RideWithGPS to get a valid API key to be able to use their API. You can request an API key by going to the link below,

https://ridewithgps.com/api

Sample .NET Core Console Application

First, add the RideWithGPS nuget package to your dotnet core application,

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

Below is a sample console applicaiton using the libary. Modify the user secret keys "apikey", "email" and "password" with your actual login information.

using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;

namespace RideWithGPS.TestClient
{
    class Program
    {
        static async Task Main(string[] args)
        {
            var config = new ConfigurationBuilder()
                            .AddUserSecrets<Program>()
                            .Build();

            // RideWithGPS API connection details
            var connection = new RideWithGPSConnectionInfo()
            {
                ApiKey = config["apikey"],
                Email = config["email"],
                Password = config["password"].ConvertToSecureString(),
            };

            // connect to the RideWithGPS API and get an auth token
            var client = await RideWithGPSClient.Connect(connection);

            // get the current user context
            var user = await client.GetCurrentUserDetails();

            // get the last 10 trips for the current user context
            var trips = await client.GetUserTrips(user.id, 0, 10);

            // print the last 10 trips
            foreach (var trip in trips)
            {
                Console.WriteLine($"Name: {trip.name} Date: {trip.created_at}");
            }

            // get the user routes and display some information about them
            var routes = client.GetUserRoutes(user.id, 0, 1000).Result;
            Console.WriteLine($"{routes.Count} routes found");

            for (int i = 0; i < routes.Count; i++)
            {
                var routeDetails = client.GetRouteDetails(routes[i].id).Result;
                Console.WriteLine($"[{i.ToString("D3")}] {routeDetails.name}: {routeDetails.track_points.Count} track points and {routeDetails.points_of_interest.Count} POIs");
            }

            // get the user events and print their name and number of routes
            (await client.GetUserEvents(user.id)).ForEach(userEvent =>
            {
                var eventDetails = client.GetEventDetails(userEvent.Id).Result;
                Console.Out.WriteLine($"Event {eventDetails.name} (Id: {eventDetails.id}) contains {eventDetails.routes.Count} route(s)");
            });
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.3 100 9/30/2024
2.0.2 91 9/30/2024
2.0.1 464 9/17/2022
2.0.0 425 9/17/2022
1.0.1 503 7/31/2020
1.0.0 432 7/21/2020