Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
.. image:: https://badge.fury.io/py/cryptodatapi.svg :target: https://badge.fury.io/py/cryptodatapi :alt: Crypto API Python Package Version
Python library for integrating with Crypto API
_ functionality.
.. _Crypto API: https://horisystems.com/crypto-api/
Python 2.7 and later.
You can install this package by using the pip tool and installing:
.. code-block:: bash
$ pip install cryptodatapi
Or:
.. code-block:: bash
$ easy_install cryptodatapi
.. code-block:: python
import cryptodatapi
from dotenv import load_dotenv
import os
## Loads environment variables from .env
load_dotenv('.env')
username = os.getenv('_USERNAME')
password = os.getenv('_PASSWORD')
## Authentication
cryptodatapi.login(username, password)
## Retrieve All Cryptocurrency Prices
cryptoPrices = cryptodatapi.get_crypto_price()
print(cryptoPrices)
## Retrieve Cryptocurrency Price by ID
cryptoPriceByID = cryptodatapi.get_crypto_price(id='<insert unique id>')
print(cryptoPriceByID)
## Retrieve Bitcoin Price
cryptoPrice = cryptodatapi.get_crypto_price(sym='BTC')
print(cryptoPrice)
## Retrieve All Cryptocurrency Top Gainers
cryptoGainers = cryptodatapi.get_gainers()
print(cryptoGainers)
## Retrieve Cryptocurrency Top Gainers by ID
cryptoGainersByID = cryptodatapi.get_gainers(id='<insert unique id>')
print(cryptoGainersByID)
## Retrieve All Cryptocurrency Top Losers
cryptoLosers = cryptodatapi.get_losers()
print(cryptoLosers)
## Retrieve Cryptocurrency Top Losers by ID
cryptoLosersByID = cryptodatapi.get_losers(id='<insert unique id>')
print(cryptoLosersByID)
## Retrieve All Cryptocurrency 2021 Historical Prices
cryptoHistorical2021 = cryptodatapi.get_hist_price_2021()
print(cryptoHistorical2021)
## Retrieve Cryptocurrency 2021 Historical Prices by ID
cryptoHistorical2021ByID = cryptodatapi.get_hist_price_2021(id='<insert unique id>')
print(cryptoHistorical2021ByID)
## Retrieve All Cryptocurrency 2022 Historical Prices
cryptoHistorical2022 = cryptodatapi.get_hist_price_2022()
print(cryptoHistorical2022)
## Retrieve Cryptocurrency 2022 Historical Prices by ID
cryptoHistorical2022ByID = cryptodatapi.get_hist_price_2022(id='<insert unique id>')
print(cryptoHistorical2022ByID)
## Retrieve All Cryptocurrency 2023 Historical Prices
cryptoHistorical2023 = cryptodatapi.get_hist_price_2023()
print(cryptoHistorical2023)
## Retrieve Cryptocurrency 2023 Historical Prices by ID
cryptoHistorical2023ByID = cryptodatapi.get_hist_price_2023(id='<insert unique id>')
print(cryptoHistorical2023ByID)
## Retrieve All Cryptocurrency Derivatives Exchanges
cryptoDerivatives = cryptodatapi.get_derivatives()
print(cryptoDerivatives)
## Retrieve Cryptocurrency Derivatives Exchanges by ID
cryptoDerivativesByID = cryptodatapi.get_derivatives(id='<insert unique id>')
print(cryptoDerivativesByID)
## Retrieve All Cryptocurrency Decentralized Exchanges
cryptoDecentralized = cryptodatapi.get_dex()
print(cryptoDecentralized)
## Retrieve Cryptocurrency Decentralized Exchanges by ID
cryptoDecentralizedByID = cryptodatapi.get_dex(id='<insert unique id>')
print(cryptoDecentralizedByID)
## Retrieve All Cryptocurrency Lending Exchanges
cryptoLending = cryptodatapi.get_lending()
print(cryptoLending)
## Retrieve Cryptocurrency Lending Exchanges by ID
cryptoLendingByID = cryptodatapi.get_lending(id='<insert unique id>')
print(cryptoLendingByID)
## Retrieve All Cryptocurrency Spot Exchanges
cryptoSpot = cryptodatapi.get_spot()
print(cryptoSpot)
## Retrieve Cryptocurrency Spot Exchanges by ID
cryptoSpotByID = cryptodatapi.get_spot(id='<insert unique id>')
print(cryptoSpotByID)
## Retrieve All Cryptocurrency News
cryptoNews = cryptodatapi.get_news()
print(cryptoNews)
## Retrieve Cryptocurrency News by ID
cryptoNewsByID = cryptodatapi.get_news(id='<insert unique id>')
print(cryptoNewsByID)
Sign up for a self-service user account
_.
.. _user account: https://horisystems.com/crypto-api/
You can read the API documentation
_ to understand what's possible with the Crypto API. If you need further assistance, don't hesitate to contact us
_.
.. _API documentation: https://docs.cryptodatapi.com/ .. _contact us: https://horisystems.com/contact/
This project is licensed under the MIT License
_.
.. _MIT License: https://horisystems.com/
Copyright |copy| 2020 - 2023 Hori Systems Limited
_. All Rights Reserved.
.. |copy| unicode:: 0xA9 .. copyright sign .. _Hori Systems Limited: https://horisystems.com/
FAQs
Python SDK for integrating with Crypto API.
We found that cryptodatapi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.