2026, Jan 10 07:00

How to fix the 'CoinGeckoClient could not be found' error in C# by switching to CoinGeckoRestClient

Learn why C# projects using CoinGecko.Net fail to find CoinGeckoClient and fix it by switching to CoinGeckoRestClient, with a working example and key API calls.

Fixing the “CoinGeckoClient could not be found” error in C# when using CoinGecko.Net

Porting a data-fetching workflow from Python to C# can be deceptively simple until the types don’t line up. If you’ve installed CoinGecko.Net and try to new up CoinGeckoClient, the compiler pushes back with “The type or namespace name 'CoinGeckoClient' could not be found.” The issue isn’t your IDE or your NuGet install. You’re referencing a type that doesn’t exist in the library.

Minimal example that reproduces the problem

using System;
using System.Threading.Tasks;
using CoinGecko.Net.Clients;
namespace SampleApp
{
    public class EntryRunner
    {
        public static async Task Main(string[] args)
        {
            var wrongClient = new CoinGeckoClient();
            Console.WriteLine("this line never compiles");
        }
    }
}

What’s going on and why it fails

The NuGet package you’re using is CoinGecko.Net. In that package, the type named CoinGeckoClient doesn’t exist, so the compiler is correct. The client you want is CoinGeckoRestClient. The repository has a concise console example that shows how to use the REST client, and you can also look directly at the client surface to see available calls and naming. Both are useful when documentation is brief.

Example program: https://github.com/JKorf/CoinGecko.Net/blob/main/Examples/CoinGecko.Examples.Console/Program.cs
Client surface: https://github.com/JKorf/CoinGecko.Net/blob/main/CoinGecko.Net/Clients/CoinGeckoRestClientApi.cs

Once you construct CoinGeckoRestClient, you make calls via the Api property, such as Api.GetOhlcAsync or Api.GetAssetDetailsAsync.

The fix and a working skeleton

using System;
using System.Threading.Tasks;
using CoinGecko.Net.Clients;
namespace SampleApp
{
    public class EntryRunner
    {
        public static async Task Main(string[] args)
        {
            var geckoRest = new CoinGeckoRestClient();
            // From here you call into the REST API surface exposed by the library.
            // For example:
            // var ohlc = await geckoRest.Api.GetOhlcAsync(...);
            // var details = await geckoRest.Api.GetAssetDetailsAsync(...);
            Console.WriteLine("CoinGeckoRestClient initialized.");
        }
    }
}

Why this detail matters

When moving code between ecosystems, type names and entry points rarely match one-to-one. Using the correct client class unlocks the actual API surface of the SDK you’ve installed and prevents you from chasing non-existent types. With sparse docs, the official example and the client implementation file are the most authoritative sources to align your calls and method names.

Takeaway

If you see “could not be found” for CoinGeckoClient in a CoinGecko.Net project, switch to CoinGeckoRestClient and invoke endpoints through the Api property. Keep the official example at hand and check the client’s source to map available calls like GetOhlcAsync and GetAssetDetailsAsync to your use case.