Blockchain API library (C#, .NET Core, v1)
An official C# (.NET Core) library for interacting with the Blockchain.info API.
This library is a migration of the original .NET library to .NET Core. Some models and namespaces have been modified. Most notably:
- Receive Payments v2 API functionality has been introduced
- Additional chart functionality has been added to the
- All documentation has been brought up to date
- All models have been moved to
- The client, exception and helper classes under the root namespace have been moved to
CreateWallet.cs, which previously contained the CreateWallet response and request models, was split into two separate models and moved to the
Info.Blockchain.API.CreateWalletnamespace was removed, the
WalletCreator.csclass moved to
The library requires .NET Core 1.1. It is possible to use this library with the .NET Framework by editing
to your project's .NET version, e.g.
The recommended way to install and use the library is via NuGet:
PM> Install-Package BlockchainAPI
The library consists of the following namespaces:
Info.Blockchain.API.Wallet(docs) (api/blockchain_wallet_api) and (api/blockchain/create_wallet)
The following namespacse contain helpers and models used by the above:
In order to use the Wallet and CreateWallet functionality, you must provide a URL to an instance of service-my-wallet-v3 as first parameter to BlockchainApiHelper. If you don't intend to use these functionalities, this parameter can be null.
All methods may throw exceptions caused by incorrectly passed parameters or other problems. If a call is rejected server-side, the
APIException exception will be thrown. Other exceptions may also be thrown by the environment (e.g. no internet connection etc).
It is possible to set arbitrary connection timeouts.
// time out after 5 seconds Info.Blockchain.API.HttpClient.TimeoutMs = 5000;
Request limits and API keys
In order to prevent abuse some API methods require an API key approved with some basic contact information and a description of its intended use. Please request an API key here. The API key can be passed to the constructor of the
BlockchainHttpClient class, which can be passed to the constructor of all other classes in this library.
The same API key can be used to bypass the request limiter.