Skip to content

Commit

Permalink
PLAT-745 Create Python API Examples
Browse files Browse the repository at this point in the history
This MR:
* creates a script `generate_examples.py` that creates python scripts for each API endpoint
* adds examples based on the API endpoint naming convention
  • Loading branch information
victoreram committed Feb 6, 2024
1 parent d6a5a3d commit 9474f00
Show file tree
Hide file tree
Showing 184 changed files with 1,590 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.blockchain_metadata_tagged_entities().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/blockchain-metadata/tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.blockchain_metadata_tags().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/blockchain-v2/{asset}/accounts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_list_of_accounts_v2(asset='<arg values>').first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_list_of_balance_updates_for_account_v2(asset='<arg values>', account='<arg values>').first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_list_of_balance_updates_v2(asset='<arg values>').first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/blockchain-v2/{asset}/blocks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_list_of_blocks_v2(asset='<arg values>').first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_full_block_v2().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_full_transaction_for_block_v2().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_list_of_sub_accounts_v2(asset='<arg values>').first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_list_of_transactions_v2(asset='<arg values>').first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_full_transaction_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/blockchain/{asset}/accounts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_list_of_accounts(asset='<arg values>').first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_list_of_balance_updates(asset='<arg values>').first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/blockchain/{asset}/blocks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_list_of_blocks(asset='<arg values>').first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_full_block().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_full_transaction_for_block().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_transaction_tracker(asset='<arg values>').first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/blockchain/{asset}/transactions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_list_of_transactions(asset='<arg values>').first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.get_full_transaction().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/asset-chains.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_asset_chains_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/asset-metrics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_asset_metrics_v2().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_exchange_asset_metrics_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/exchange-metrics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_exchange_metrics_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/index-candles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_index_candles_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/index-levels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_index_levels_v2().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_institution_metrics_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/market-candles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_market_candles_v2().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_market_contract_prices_v2().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_market_funding_rates_predicted_v2().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_market_funding_rates_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/market-greeks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_market_greeks_v2().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_market_implied_volatility_v2().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_market_liquidations_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/market-metrics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_market_metrics_v2().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_market_open_interest_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/market-orderbooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_market_orderbooks_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/market-quotes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_market_quotes_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/market-trades.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_market_trades_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/mempool-feerates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_mempool_feerates_v2().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_mining_pool_tips_summaries_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/pair-candles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_pair_candles_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all-v2/pair-metrics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_pair_metrics_v2().first_page()
print(data)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_transaction_tracker_assets_v2().first_page()
print(data)
8 changes: 8 additions & 0 deletions examples/api_doc_examples/catalog-all/asset-alerts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

from coinmetrics.api_client import CoinMetricsClient

api_key = "<API_KEY>"
client = CoinMetricsClient(api_key)

data = client.catalog_full_asset_alerts().first_page()
print(data)
Loading

0 comments on commit 9474f00

Please sign in to comment.