Skip to main content

The unofficial Python client for the Coinbase Advanced Trade API

Project description

Coinbase Advanced Trade API Python Client

This is the unofficial Python client for the Coinbase Advanced Trade API. It allows users to interact with the API to manage their cryptocurrency trading activities on the Coinbase platform.

Features

  • Easy-to-use Python wrapper for the Coinbase Advanced Trade API
  • Supports all endpoints and methods provided by the official API
  • Lightweight and efficient wrapper
  • Added support for trading strategies covered on the YouTube channel

Setup

  1. Clone this repository or download the source files by running
       pip install coinbase-advancedtrade-python
    
  2. Install the required Python packages:
       pip install -r requirements.txt
    
  3. Set your API key and secret in config.py. To obtain your API key and secret, follow the steps below:
    • Log in to your Coinbase account.
    • Navigate to API settings.
    • Create a new API key with the appropriate permissions.
    • Copy the API key and secret to config.py.

Authentication

Here's an example of how to authenticate:

from coinbase_advanced_trader.config import set_api_credentials

# Set your API key and secret
API_KEY = "ABCD1234"
API_SECRET = "XYZ9876"

# Set the API credentials once, and it updates the CBAuth singleton instance
set_api_credentials(API_KEY, API_SECRET)

Usage of Strategies

Here's an example of how to use the strategies package to buy $20 worth of Bitcoin:

from coinbase_advanced_trader.strategies.limit_order_strategies import fiat_limit_buy

# Define the trading parameters
product_id = "BTC-USD"  # Replace with your desired trading pair
usd_size = 20  # Replace with your desired USD amount to spend

# Perform a limit buy for just below the spot price of your desired trading pair
limit_buy_order = fiat_limit_buy(product_id, usd_size)
print("Limit Sell Order Response:", limit_buy_order)

Documentation

For more information about the Coinbase Advanced Trader API, consult the official API documentation.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Author

Rhett Reisman

Email: rhett@rhett.blog

GitHub: https://github.com/rhettre/coinbase-advancedtrade-python

Disclaimer

This project is not affiliated with, maintained, or endorsed by Coinbase. Use this software at your own risk. Trading cryptocurrencies carries a risk of financial loss. The developers of this software are not responsible for any financial losses or damages incurred while using this software.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coinbase-advancedtrade-python-0.1.4.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file coinbase-advancedtrade-python-0.1.4.tar.gz.

File metadata

File hashes

Hashes for coinbase-advancedtrade-python-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a2ccef106b47b32061d2f1841a620ba0bccc00b0e2b9822bb3c3497f82a3a1b4
MD5 f9a3e754b261dc1965bf586fa59380ca
BLAKE2b-256 f6fd3c010ba29712d1e1e5ab461249734803c9e0fe4474b9c1563a7bcf39fa42

See more details on using hashes here.

Provenance

File details

Details for the file coinbase_advancedtrade_python-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for coinbase_advancedtrade_python-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 db823b1b41eb5156308d84a78daf72b772b6dd0f306ba66a1b28f0c74f5ca52b
MD5 f6c6d288a4439542fc6fdabb9143aa94
BLAKE2b-256 afc8e8896df10f548d5cc5e359da1ab959406e4af7d07114c2245aba25cfa72b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page