Sharpe API
Project description
sharpe-api
Institutional-grade crypto market data API. Access funding rates, futures, options, arbitrage opportunities, narratives, ecosystems, and more.
Authentication is supported via three methods:
- Bearer token in the Authorization header:
Authorization: Bearer sk_... - X-API-Key header:
X-API-Key: sk_... - Query parameter:
?api_key=sk_...(useful for webhooks, browser links, and environments where setting headers is not possible)
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.0
- Generator version: 7.21.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://sharpe.ai
Requirements.
Python 3.9+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)
Then import the package:
import sharpe_api
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import sharpe_api
Tests
Execute pytest to run the tests.
Getting Started
Please follow the installation procedure and then run the following:
import sharpe_api
from sharpe_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.sharpe.ai
# See configuration.py for a list of all supported configuration parameters.
configuration = sharpe_api.Configuration(
host = "https://api.sharpe.ai"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Configure Bearer authorization: BearerAuth
configuration = sharpe_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with sharpe_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = sharpe_api.AccountApi(api_client)
try:
# API usage and quota
api_response = api_instance.get_usage()
print("The response of AccountApi->get_usage:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling AccountApi->get_usage: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://api.sharpe.ai
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AccountApi | get_usage | GET /v1/usage | API usage and quota |
| ArbitrageApi | get_cross_exchange_arbitrage | GET /v1/arbitrage/cross-exchange | Cross-exchange arbitrage |
| ArbitrageApi | get_spot_perp_arbitrage | GET /v1/arbitrage/spot-perp | Spot-perp arbitrage |
| CategoriesApi | get_ecosystems_data | GET /v1/ecosystems/data | Ecosystems data |
| CategoriesApi | get_memecoins_data | GET /v1/memecoins/data | Memecoins data |
| CategoriesApi | get_narratives_data | GET /v1/narratives/data | Narratives data |
| DerivativesApi | get_funding_rates | GET /v1/funding/rates | Funding rates |
| DerivativesApi | get_futures_coins | GET /v1/futures/coins | Available futures coins |
| DerivativesApi | get_futures_data | GET /v1/futures/data | Futures chart data |
| DerivativesApi | get_options_data | GET /v1/options/data | Options chart data |
| ExchangeListingsApi | get_listings_data | GET /v1/listings/data | Exchange listings hub data |
| ExchangeListingsApi | get_listings_recent | GET /v1/listings/recent | Recent exchange listings |
| MarketDataApi | get_correlation_matrix | GET /v1/correlation/matrix | Correlation matrix |
| MarketDataApi | get_derivatives_overview | GET /v1/market/derivatives-overview | Market-wide derivatives overview |
| MarketDataApi | get_gem_finder_data | GET /v1/gem-finder/data | Gem finder |
| MarketDataApi | get_heatmap_data | GET /v1/heatmap/data | Market heatmap |
| MarketDataApi | get_market_overview | GET /v1/tracker/market-overview | Market overview |
| MarketDataApi | get_news_feed | GET /v1/news/feed | News feed |
| MarketDataApi | get_price_prediction_data | GET /v1/price-prediction/data | Price prediction |
| MarketDataApi | search_market_cap | GET /v1/market-cap/search | Market cap search |
| SystemApi | get_coverage | GET /v1/meta/coverage | API data coverage |
| SystemApi | get_health | GET /v1/health | Health check |
Documentation For Models
- ApiMeta
- ErrorResponse
- FuturesCoin
- GetFundingRates200Response
- GetFuturesCoins200Response
- GetFuturesCoins200ResponseAllOfData
- GetUsage200Response
- HealthResponse
- HealthResponseChecks
- PaginatedEnvelope
- PaginationInfo
- SuccessEnvelope
- UsageData
- UsageDataLast24h
- UsageDataLast24hByEndpointValue
- UsageDataPlan
- UsageDataQuota
- UsageDataRateLimit
Documentation For Authorization
Authentication schemes defined for the API:
BearerAuth
- Type: Bearer authentication
ApiKeyAuth
- Type: API key
- API key parameter name: X-API-Key
- Location: HTTP header
Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters