SDKs overview
Coinigy provides programmatic access to its multi-exchange cryptocurrency trading and portfolio management platform primarily through a REST API. This API allows developers to integrate Coinigy's functionality into custom applications, including automated trading strategies, advanced charting tools, and personalized portfolio trackers. The platform offers official Software Development Kits (SDKs) in several programming languages to simplify interaction with this API, abstracting away direct HTTP request handling and authentication complexities.
In addition to official SDKs, the Coinigy ecosystem includes community-contributed libraries. These third-party tools extend the platform's reach, often providing specialized features or supporting languages not covered by official releases. Developers typically choose between engaging with an official SDK for stability and direct support, or a community library for specific use cases or preferred language environments. Access to Coinigy's API and associated SDKs generally requires an active paid subscription to the service, as detailed on the Coinigy pricing page.
Official SDKs by language
Coinigy maintains official SDKs designed to streamline development by providing language-specific interfaces for its REST API. These SDKs handle tasks such as authentication, request formatting, and response parsing. The official offerings currently include support for Python and Node.js, catering to common environments for financial technology and web development.
| Language | Package Name | Install Command | Maturity Level |
|---|---|---|---|
| Python | coinigy |
pip install coinigy |
Stable |
| Node.js | coinigy-api |
npm install coinigy-api |
Stable |
Each SDK is designed to reflect the underlying REST API structure, making it consistent to migrate between direct API calls and SDK usage if necessary. Developers can refer to Coinigy's official documentation for detailed API endpoints and SDK-specific method descriptions. The Python SDK leverages standard Python libraries for HTTP requests, while the Node.js SDK utilizes asynchronous JavaScript patterns, aligning with typical development practices in each language.
Installation
Installing Coinigy's official SDKs involves using the respective package managers for Python and Node.js. These commands retrieve the necessary libraries from public repositories and integrate them into your development environment, preparing them for use in your applications. Consistent with software development best practices, it is recommended to perform installations within virtual environments to manage dependencies effectively and avoid conflicts with other projects.
Python SDK Installation
To install the Coinigy Python SDK, pip is the recommended package installer for Python. Before installation, consider creating a virtual environment:
- Create a virtual environment (optional but recommended):
python3 -m venv coinigy_env source coinigy_env/bin/activate # On Windows, use `coinigy_env\Scripts\activate` - Install the Coinigy Python package:
pip install coinigy
This command downloads and installs the official coinigy library, along with any required dependencies, into your active environment. More information regarding Python package management can be found in the pip User Guide.
Node.js SDK Installation
For the Node.js SDK, npm (Node Package Manager) is the standard tool for library management.
- Ensure Node.js and npm are installed:
If not already installed, refer to npm's official installation guide.
- Initialize a new Node.js project (optional but recommended):
mkdir coinigy-project cd coinigy-project npm init -y - Install the Coinigy Node.js package:
npm install coinigy-api
This command adds the coinigy-api package to your project's node_modules directory and updates your package.json file. Both installation methods prepare your development environment for interacting with the Coinigy API programmatically.
Quickstart example
This quickstart example demonstrates how to initialize the Coinigy Python SDK and fetch account balances. Similar principles apply to the Node.js SDK, where asynchronous functions would be utilized.
Python Quickstart: Fetching Account Balances
Before running this code, ensure you have your Coinigy API key and secret. These credentials are generated within your Coinigy account settings, typically in the "API Keys" section, and are required for authenticating requests to the API. It is critical to secure these credentials and avoid hardcoding them directly into public repositories.
import os
from coinigy import Coinigy
# It's recommended to store API key and secret as environment variables
API_KEY = os.environ.get('COINIGY_API_KEY')
API_SECRET = os.environ.get('COINIGY_API_SECRET')
if not API_KEY or not API_SECRET:
print("Error: COINIGY_API_KEY and COINIGY_API_SECRET environment variables must be set.")
exit()
try:
# Initialize the Coinigy API client
coinigy_client = Coinigy(API_KEY, API_SECRET)
# Fetch account balances
print("Fetching account balances...")
balances = coinigy_client.balances()
if balances and isinstance(balances, dict) and 'data' in balances:
print("Account Balances:")
for account in balances['data']:
print(f" Exchange: {account.get('exch_code', 'N/A')}")
print(f" Balance: {account.get('bal_display', 'N/A')}")
print(f" Available: {account.get('bal_avail', 'N/A')}")
print(f" Pending: {account.get('bal_pending', 'N/A')}")
print("---------------------")
elif balances and isinstance(balances, dict) and 'error' in balances:
print(f"API Error: {balances['error']}")
else:
print("No balances data received or unexpected response format.")
except Exception as e:
print(f"An unexpected error occurred: {e}")
To execute this Python script:
- Save the code as a
.pyfile (e.g.,get_balances.py). - Set your API key and secret as environment variables:
export COINIGY_API_KEY="YOUR_API_KEY" export COINIGY_API_SECRET="YOUR_API_SECRET" - Run the script from your terminal:
python get_balances.py
This script will connect to the Coinigy API, authenticate using your credentials, and print a formatted list of your account balances across all connected exchanges. This example illustrates a fundamental data retrieval operation, which can be extended to execute trades, manage orders, and access historical data using other SDK methods.
Community libraries
In addition to the official SDKs, the Coinigy developer community has contributed various libraries and tools that extend the platform's functionality or offer alternative ways to interact with the API. These community-driven projects can sometimes provide support for different programming languages, specialized trading strategies, or integrations with other financial tools. While not officially maintained or supported by Coinigy, these libraries can be valuable resources for developers seeking solutions outside the scope of the official offerings.
The existence of community libraries is a common feature in API ecosystems, allowing diverse development needs to be met. For example, some community tools might focus on specific analytical charting integrations, advanced backtesting capabilities, or offer wrappers in languages like Go or Ruby. Developers interested in exploring these options typically consult public repositories like GitHub, which serves as a common platform for open-source development and collaboration, as described in GitHub's guide to open-source projects. Searching for "Coinigy API" or "Coinigy SDK" on such platforms often reveals a range of community-developed projects.
When using community libraries, it is important to assess their maintenance status, last update, and community support. Dependencies and security practices should also be reviewed, as these are not subject to the same vetting as official SDKs. Developers are encouraged to examine the source code, review issues, and confirm compatibility with the latest Coinigy API versions to ensure reliability and security in production environments. Engagement with the community through forums or project issue trackers can also provide insights into the stability and ongoing development of these third-party tools.