SDKs overview
ZMOK offers a suite of Software Development Kits (SDKs) designed to facilitate interaction with its blockchain and cryptocurrency data APIs. These SDKs abstract the underlying HTTP requests and response parsing, enabling developers to integrate ZMOK's services using familiar programming constructs within their preferred language environments. The official SDKs support several popular programming languages, ensuring broad compatibility for various development projects requiring access to real-time market data, historical blockchain records, or NFT-related information (ZMOK developer documentation).
The primary benefit of using an SDK over direct API calls is the reduction in boilerplate code. SDKs typically handle aspects such as authentication, request formatting, error handling, and data deserialization, allowing developers to focus on application logic rather than API mechanics. This approach can accelerate development cycles and reduce the potential for integration errors. ZMOK's SDKs are designed to provide consistent interfaces across different languages where possible, simplifying multi-language project development or team collaboration.
In addition to official SDKs, the ZMOK ecosystem may include community-contributed libraries. While not officially maintained by ZMOK, these libraries can offer alternative implementations, specialized functionalities, or support for languages not covered by official SDKs. Developers are advised to review the maturity, maintenance status, and community support for any third-party libraries before integrating them into production systems.
Official SDKs by language
ZMOK provides official SDKs for a range of programming languages, developed and maintained by the ZMOK team to ensure compatibility and optimal performance with their API. These SDKs are the recommended method for integrating ZMOK services into applications. Each SDK is tailored to the conventions and best practices of its respective language, offering an idiomatic development experience. The core products accessible through these SDKs include blockchain data APIs, real-time market data, historical data, and NFT APIs (ZMOK homepage).
JavaScript SDK
The JavaScript SDK is suitable for both Node.js environments and client-side web applications. It provides methods for asynchronous API calls, aligning with common JavaScript development patterns. Developers can interact with various ZMOK endpoints for cryptocurrency price feeds, transaction data, and NFT metadata. This SDK is particularly useful for building dynamic web interfaces that display blockchain-related information or for backend services written in Node.js.
Python SDK
The Python SDK is designed for backend services, data analysis scripts, and command-line tools. It leverages Python's extensive ecosystem for data processing and scientific computing, making it a strong choice for applications requiring historical data analysis or automated market monitoring. The Python SDK simplifies access to blockchain data, allowing developers to retrieve and process information efficiently.
Go SDK
The Go SDK is optimized for performance-critical applications and microservices architectures. Go's concurrency model (goroutines and channels) can be utilized to handle high volumes of API requests efficiently. This SDK is ideal for building scalable backend systems that need reliable, high-throughput access to ZMOK's real-time and historical blockchain datasets.
Ruby SDK
The Ruby SDK caters to developers working with Ruby on Rails applications or other Ruby-based systems. It offers a convenient interface for integrating ZMOK functionalities into web applications, scripting tools, and automation tasks. The Ruby SDK focuses on developer productivity and ease of use, consistent with the Ruby language philosophy.
Java SDK
The Java SDK is built for enterprise-grade applications, Android development, and large-scale backend systems. Java's strong typing and robust ecosystem provide a stable foundation for complex integrations. The SDK allows Java developers to access ZMOK's full range of APIs, including blockchain transaction data and real-time market updates, within their existing Java projects.
C# SDK
The C# SDK is tailored for .NET developers building desktop applications, web services with ASP.NET, or cloud-native solutions on Azure. It integrates seamlessly into the .NET ecosystem, providing a familiar programming model for accessing ZMOK's blockchain and crypto data. The C# SDK supports modern asynchronous programming patterns for efficient API interaction.
Here is a summary of the official SDKs:
| Language | Package/Module | Install Command (Example) | Maturity |
|---|---|---|---|
| JavaScript | @zmok/sdk-js |
npm install @zmok/sdk-js or yarn add @zmok/sdk-js |
Stable |
| Python | zmok-sdk-py |
pip install zmok-sdk-py |
Stable |
| Go | github.com/zmok/go-sdk |
go get github.com/zmok/go-sdk |
Stable |
| Ruby | zmok-sdk-ruby |
gem install zmok-sdk-ruby |
Stable |
| Java | com.zmok.sdk-java |
Maven: <dependency><groupId>com.zmok</groupId><artifactId>sdk-java</artifactId><version>1.0.0</version></dependency> |
Stable |
| C# | Zmok.Sdk.CSharp |
dotnet add package Zmok.Sdk.CSharp |
Stable |
Installation
Installing ZMOK SDKs typically involves using the standard package manager for the respective programming language. Each SDK is distributed through official channels, ensuring developers receive the correct and most up-to-date version. Before installation, developers should ensure they have the appropriate language runtime and package manager installed on their system.
JavaScript (Node.js/npm)
For Node.js projects, use npm or yarn to add the JavaScript SDK to your project dependencies. This will download the package and add it to your node_modules directory, making it available for import in your JavaScript files.
npm install @zmok/sdk-js
# or
yarn add @zmok/sdk-js
Python (pip)
Python developers can install the ZMOK Python SDK using pip, the standard package installer for Python packages. It is often recommended to install packages within a Python virtual environment to manage project dependencies independently.
pip install zmok-sdk-py
Go (go get)
For Go projects, the SDK can be fetched and installed using the go get command. This command retrieves the package from its source repository (typically GitHub) and places it in your Go module cache.
go get github.com/zmok/go-sdk
Ruby (gem)
Ruby applications can integrate the ZMOK Ruby SDK by using gem install. Gems are the standard way to package and distribute Ruby programs and libraries. Add the gem to your project's Gemfile for Bundler-managed projects.
gem install zmok-sdk-ruby
Java (Maven/Gradle)
Java developers typically manage dependencies using build automation tools like Maven or Gradle. The ZMOK Java SDK is available through standard Maven central repositories. Developers need to add the appropriate dependency entry to their pom.xml (for Maven) or build.gradle (for Gradle) file.
Maven example:
<dependency>
<groupId>com.zmok</groupId>
<artifactId>sdk-java</artifactId>
<version>1.0.0</version> <!-- Check ZMOK docs for latest version -->
</dependency>
Gradle example:
implementation 'com.zmok:sdk-java:1.0.0' // Check ZMOK docs for latest version
C# (NuGet)
For C# projects, the ZMOK SDK is distributed as a NuGet package. Developers can install it using the .NET CLI or through the NuGet Package Manager in Visual Studio.
dotnet add package Zmok.Sdk.CSharp
Quickstart example
This section provides quickstart examples for accessing ZMOK's real-time cryptocurrency market data using the JavaScript and Python SDKs. These snippets demonstrate basic authentication and a simple data retrieval operation, such as fetching the latest Bitcoin price. To use these examples, developers will need an API key, which can be obtained by signing up for a ZMOK account (ZMOK pricing plans).
JavaScript Quickstart (Node.js)
This example demonstrates how to initialize the ZMOK JavaScript SDK and fetch the current price of Bitcoin (BTC) against the US Dollar (USD). Ensure your ZMOK_API_KEY environment variable is set or replace process.env.ZMOK_API_KEY with your actual API key.
const zmok = require('@zmok/sdk-js');
const API_KEY = process.env.ZMOK_API_KEY; // Always use environment variables for keys
if (!API_KEY) {
console.error('ZMOK_API_KEY environment variable not set.');
process.exit(1);
}
const client = new zmok.Client(API_KEY);
async function getBitcoinPrice() {
try {
const response = await client.marketData.getLatestPrice('BTC', 'USD');
console.log('Current BTC/USD Price:', response.data.price);
} catch (error) {
console.error('Error fetching Bitcoin price:', error.message);
}
}
getBitcoinPrice();
Python Quickstart
This Python example illustrates how to use the ZMOK Python SDK to retrieve real-time market data for Bitcoin. Replace YOUR_API_KEY with your actual ZMOK API key or configure it as an environment variable for better security practices.
import os
from zmok_sdk_py import ZmokClient
API_KEY = os.environ.get("ZMOK_API_KEY") # Get API key from environment variable
if not API_KEY:
print("Error: ZMOK_API_KEY environment variable not set.")
exit(1)
client = ZmokClient(API_KEY)
def get_bitcoin_price():
try:
# Access market data endpoints
response = client.market_data.get_latest_price(base_asset='BTC', quote_asset='USD')
print(f"Current BTC/USD Price: {response['data']['price']}")
except Exception as e:
print(f"Error fetching Bitcoin price: {e}")
if __name__ == "__main__":
get_bitcoin_price()
Community libraries
While official SDKs are provided and maintained by ZMOK, the developer community often contributes additional libraries and tools. These community-driven projects can extend ZMOK's functionality, offer specialized client implementations, or provide support for languages and frameworks not officially covered. Examples might include wrappers for specific web frameworks, data visualization tools integrated with ZMOK data, or alternative client libraries focusing on niche use cases. This mirrors a common pattern in the API ecosystem, where diverse community efforts augment vendor-provided resources, as observed with other blockchain data providers and general API platforms (Stripe's SDKs and libraries).
Developers interested in community libraries should search platforms like GitHub, npm, PyPI, or RubyGems for projects tagged with 'zmok' or related blockchain terms. When considering a community library, it is important to evaluate several factors:
- Maintenance Status: Check the project's last update, open issues, and pull requests to gauge active development.
- Documentation: Adequate documentation is crucial for understanding how to use the library and its limitations.
- Community Support: A vibrant community can offer assistance, bug fixes, and feature requests.
- Security: Review the code if possible, especially for libraries handling API keys or sensitive data, to ensure adherence to security best practices.
- Compatibility: Verify that the library is compatible with the latest ZMOK API versions and your project's dependencies.
While community libraries can offer flexibility and innovation, official SDKs generally provide the most stable and directly supported integration path. The choice between an official SDK and a community library depends on project requirements, risk tolerance, and the specific features offered by each option.