SDKs overview

Styvio provides Software Development Kits (SDKs) to facilitate interaction with its financial market data APIs. These SDKs are designed to abstract the underlying HTTP requests, authentication, and JSON response parsing, allowing developers to integrate market data into their applications with reduced boilerplate code. Styvio's API offers access to real-time and historical data for stocks, options, forex, and cryptocurrencies, catering to use cases such as quantitative analysis, trading application development, and portfolio management systems Styvio developer documentation. The availability of official SDKs for popular programming languages aims to streamline the development process and improve developer experience.

SDKs typically handle responsibilities such as:

  • Authentication: Managing API keys or tokens for secure access to Styvio's services.
  • Request Formatting: Constructing API requests with correct endpoints, parameters, and headers.
  • Response Handling: Parsing JSON responses into native language objects or data structures.
  • Error Handling: Providing structured error messages or exceptions for API-related issues.
  • Rate Limiting: Implementing mechanisms to respect API rate limits, though developers are still responsible for managing their overall usage within their plan's constraints.

The SDKs are maintained by Styvio and are intended to be the primary method for programmatic access to the API for the languages they support. Developers working in other languages can directly use the Styvio REST API reference to build custom integrations.

Official SDKs by language

Styvio offers official SDKs for Python, Node.js, and Go, which are directly supported and maintained by the Styvio development team. These SDKs are published through standard package managers for each respective language, ensuring ease of installation and updates. Each SDK is designed to reflect the structure and capabilities of the underlying Styvio API endpoints, providing idiomatic access to financial data feeds. Developers can find detailed usage examples and API specifics within the official Styvio documentation.

Language Package Manager Package Name Maturity
Python pip styvio-python Stable
Node.js npm @styvio/nodejs Stable
Go go get github.com/styvio/go-sdk Stable

These SDKs aim to provide a consistent and reliable interface for developers, abstracting away the intricacies of HTTP requests and JSON parsing. They are regularly updated to ensure compatibility with the latest API versions and to introduce new features as they become available. Developers are encouraged to refer to the specific SDK documentation for the most current information on methods, parameters, and return types for each language.

Installation

Installation of Styvio's official SDKs follows standard practices for each programming ecosystem. Developers should ensure they have the appropriate package manager installed and configured for their development environment. Each SDK is typically installed via a single command, retrieving the necessary libraries and dependencies from their respective repositories.

Python SDK Installation

The Python SDK for Styvio can be installed using pip, the Python package installer. It is recommended to use a virtual environment to manage project dependencies.

pip install styvio-python

After installation, the package can be imported into Python scripts. Python's versatility makes it a common choice for data analysis and financial modeling, as noted by resources like Mozilla's Python developer resources describing its wide application.

Node.js SDK Installation

For Node.js projects, the Styvio SDK is available via npm, the Node.js package manager. This installation method integrates the SDK directly into your project's node_modules directory.

npm install @styvio/nodejs

Upon successful installation, the SDK can be imported using standard Node.js require or ES6 import syntax within your JavaScript or TypeScript files.

Go SDK Installation

The Go SDK for Styvio is installed using the go get command, which fetches the package from its GitHub repository and adds it to your Go module cache.

go get github.com/styvio/go-sdk

After running go get, the package can be imported into your Go source files. Go's strong typing and performance characteristics are often favored for backend services and high-frequency trading systems.

It's important to verify the installed version against the official Styvio SDK documentation to ensure compatibility with your application and the latest API features. Dependencies for each SDK are managed automatically by their respective package managers during installation.

Quickstart example

This quickstart example demonstrates how to retrieve real-time stock data for a specific symbol using the Styvio Python SDK. Before running the code, ensure you have installed the styvio-python package and have your Styvio API key available.

Python Quickstart

First, set your API key as an environment variable or replace 'YOUR_STYVIO_API_KEY' with your actual key. This example fetches the latest quote for 'AAPL' (Apple Inc.).

import os
from styvio_python import StyvioClient

# Initialize the client with your API key
# It's recommended to store your API key securely, e.g., in an environment variable
api_key = os.environ.get('STYVIO_API_KEY', 'YOUR_STYVIO_API_KEY')
client = StyvioClient(api_key=api_key)

try:
    # Get real-time stock data for AAPL
    symbol = 'AAPL'
    realtime_data = client.get_realtime_stock_data(symbol=symbol)

    if realtime_data:
        print(f"Real-time data for {symbol}:")
        print(f"  Price: {realtime_data.price}")
        print(f"  Volume: {realtime_data.volume}")
        print(f"  Timestamp: {realtime_data.timestamp}")
    else:
        print(f"No real-time data found for {symbol}")

except Exception as e:
    print(f"An error occurred: {e}")

This snippet initializes the Styvio client with an API key and then calls the get_realtime_stock_data method. The response object typically contains fields such as price, volume, and a timestamp, providing immediate access to current market conditions. For more detailed examples and methods, consult the Styvio API reference documentation.

Node.js Quickstart

This example retrieves historical daily stock data for a symbol using the Node.js SDK. Replace 'YOUR_STYVIO_API_KEY' with your actual key.

const StyvioClient = require('@styvio/nodejs').StyvioClient;

// Initialize the client
const apiKey = process.env.STYVIO_API_KEY || 'YOUR_STYVIO_API_KEY';
const client = new StyvioClient(apiKey);

async function getHistoricalData() {
    try {
        const symbol = 'MSFT';
        const from = '2023-01-01';
        const to = '2023-01-05';
        const historicalData = await client.getHistoricalStockData({ symbol, from, to });

        if (historicalData && historicalData.length > 0) {
            console.log(`Historical data for ${symbol} from ${from} to ${to}:`);
            historicalData.forEach(day => {
                console.log(`  Date: ${day.date}, Open: ${day.open}, Close: ${day.close}, High: ${day.high}, Low: ${day.low}, Volume: ${day.volume}`);
            });
        } else {
            console.log(`No historical data found for ${symbol} in the specified range.`);
        }
    } catch (error) {
        console.error(`An error occurred: ${error.message}`);
    }
}

getHistoricalData();

This Node.js example demonstrates asynchronous API calls to fetch a range of historical daily data, which is useful for backtesting strategies or charting historical performance.

Go Quickstart

This Go example fetches options data for a given symbol and expiration date. Ensure your API key is configured.

package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/styvio/go-sdk/pkg/styvio"
)

func main() {
	apiKey := os.Getenv("STYVIO_API_KEY")
	if apiKey == "" {
		log.Fatal("STYVIO_API_KEY environment variable not set")
	}

	client := styvio.NewClient(apiKey)

	// Get options data for SPY expiring 2024-12-20
	symbol := "SPY"
	expirationDate := "2024-12-20"

	optionsData, err := client.GetOptionsData(context.Background(), symbol, expirationDate)
	if err != nil {
		log.Fatalf("Failed to get options data: %v", err)
	}

	if len(optionsData.Calls) > 0 || len(optionsData.Puts) > 0 {
		fmt.Printf("Options data for %s expiring %s:\n", symbol, expirationDate)
		fmt.Printf("  Calls: %d contracts\n", len(optionsData.Calls))
		fmt.Printf("  Puts: %d contracts\n", len(optionsData.Puts))
		// Further processing of individual calls/puts can be done here
	} else {
		fmt.Printf("No options data found for %s expiring %s.\n", symbol, expirationDate)
	}
}

The Go quickstart illustrates how to access options chain data, which is critical for derivatives trading and analysis. The context.Background() is used here for simplicity, but in production applications, a more specific context with timeouts or cancellation might be preferred, aligning with standard Go concurrency patterns.

These quickstart examples cover basic data retrieval. The Styvio documentation offers more advanced use cases, including error handling strategies, pagination for large datasets, and specific methods for different data types like forex or cryptocurrency data.

Community libraries

While Styvio provides official SDKs for Python, Node.js, and Go, the developer community may also contribute unofficial libraries or wrappers for other languages or specific frameworks. These community-maintained resources can offer alternative approaches to integration or extend functionality in ways not covered by the official SDKs.

As of late 2025, there are no widely recognized or officially endorsed community-contributed libraries for Styvio listed in its documentation or on popular code repositories like GitHub that meet the criteria for a stable and broadly used alternative to the official SDKs. Developers interested in contributing or finding community-driven projects are encouraged to:

  • Check platforms like GitHub for repositories tagged with styvio or styvio-api.
  • Participate in developer forums or communities where Styvio users discuss integrations.
  • Consult the Styvio developer documentation or community sections for any emerging third-party tools.

Developers considering using a community-maintained library should evaluate its:

  • Maintenance Status: How actively is the library maintained and updated?
  • Documentation: Is there clear documentation for installation and usage?
  • Community Support: Is there an active community around the library for support?
  • Compatibility: Does it support the latest version of the Styvio API?
  • Security: Are there any known security vulnerabilities or best practices for secure API key handling?

For critical applications, relying on Styvio's official SDKs or direct API integration is generally recommended due to direct vendor support and guaranteed compatibility with the Styvio platform. The OpenAPI Specification, which Styvio also supports, enables automatic client generation for various languages, potentially serving as a foundation for community tools.