OpenFIGI Rust Client
âšī¸ API Notice: The API is subject to change in the future and is not yet stable.
A high-performance Rust client library for the OpenFIGI API, providing type-safe access to financial instrument identification and mapping services.
OpenFIGI is Bloomberg's open symbology initiative that provides standardized identification for financial instruments across asset classes and markets worldwide.
⨠Features
- đ Type-safe API - Strongly typed request/response models with compile-time validation
- ⥠Async/await support - Built on
reqwestwith full async support and connection pooling - đ§ Middleware support - Extensible HTTP middleware for retries, logging, and observability
- đ Comprehensive error handling - Detailed error types with OpenFIGI-specific context
- đ Production ready - Connection pooling, timeouts, and efficient resource management
- đ Environment integration - Automatic API key detection from environment variables
- đ Rate limit awareness - Automatic rate limit detection and informative error messages
- đ Batch operations - Support for bulk requests (up to 100 with API key, 5 without)
đ Quick Start
Add this to your Cargo.toml:
[]
= "<latest-version>"
Basic Usage
use OpenFIGIClient;
use IdType;
use json;
async
With Custom Configuration
use OpenFIGIClient;
use ClientBuilder;
use ;
use Duration;
async
đ Authentication & Rate Limits
API Key Setup
Set your API key as an environment variable:
Or configure it explicitly:
let client = builder
.api_key
.build?;
Rate Limits
| Type of Limitation | Without API Key | With API Key |
|---|---|---|
| Max Amount of Requests | 25 Per Minute | 25 Per 6 Seconds |
| Max Jobs Per Request | 10 Jobs | 100 Jobs |
đ API Endpoints
Mapping Endpoint
Convert third-party identifiers to FIGIs:
use ;
// Single mapping request
let result = client
.mapping
.currency
.exch_code
.send
.await?;
// Bulk mapping request
use MappingRequest;
let requests = vec!;
let results = client
.bulk_mapping
.add_requests
.send
.await?;
Search Endpoint
Text-based instrument search:
use Currency;
let results = client
.search
.currency
.send
.await?;
Filter Endpoint
Filter instruments by criteria:
use SecurityType;
let results = client
.filter
.query
.security_type
.send
.await?;
đ ī¸ Advanced Usage
Error Handling
use OpenFIGIError;
match client.mapping.send.await
Production Configuration
use Duration;
use ClientBuilder;
use ;
let http_client = builder
.timeout
.connect_timeout
.pool_idle_timeout
.pool_max_idle_per_host
.build?;
let retry_policy = builder
.retry_bounds
.build_with_max_retries;
let middleware_client = new
.with
.build;
let client = builder
.middleware_client
.api_key
.build?;
đ Documentation
- API Documentation - Complete API reference
- OpenFIGI API Documentation - Official API docs
đ¤ Contributing
We welcome contributions! Please see CONTRIBUTING.md for details.
đ License
This project is licensed under the MIT License - see the LICENSE file for details.
đ Acknowledgments
- OpenFIGI for providing the API and documentation
- Bloomberg for the OpenFIGI initiative
- The Rust community for excellent HTTP and async libraries
đ Support
- đ Documentation
- đ Issue Tracker
- đŦ Discussions
Note: This library is not officially affiliated with Bloomberg or OpenFIGI. It's an independent implementation of the OpenFIGI API client for Rust.