Comments (9)
gdax-node is having the same discussion coinbase/coinbase-pro-node#61
from coinbasepro-python.
https://docs.gdax.com/#get-historic-rates
The maximum number of data points for a single request is 200 candles. If your selection of start/end time and granularity will result in more than 200 data points, your request will be rejected. If you wish to retrieve fine granularity data over a larger time range, you will need to make multiple requests with new start/end ranges.
from coinbasepro-python.
Right, there's currently no rate-limiting in this project. Have you encountered any 429 responses in your usage? I've found in testing that requests made serially (such as retrieving a full order history) execute just fine since my typical round-trip request time is about 0.5 seconds. I've even tried flooding the public API with multi-threaded requests and didn't get any 429 responses.
If it is an issue for you, it's definitely possible to look into it.
from coinbasepro-python.
I would love to look into this more. Anyone experiencing this, please drop a quick "ME!" or thumps up in this thread :)
from coinbasepro-python.
If it is an issue for you, it's definitely possible to look into it.
I haven't use GDAX-Python yet, I was just researching which library to use.. :)
from coinbasepro-python.
ME! I get the quite frequently.
What I was trying to do is to just get the best bid / ask at any given time. One idea would be to use the feed and generate the best bid / ask yourself (as it is done in order_book.py)
or just send get_product_order_book()
in a loop.
The latter one obviously results in rate limits if you don't slow it down.
The first one however has a long round trip (as @acontry pointed out).
Does anyone have an idea how to solve this problem?
from coinbasepro-python.
@jonnylangefeld using one of the websocket feeds is ideal for that use case, no continuous http requests required. If you really want to make a bunch of http requests, GDAX describes their rate limiting as:
"We throttle public endpoints by IP: 3 requests per second, up to 6 requests per second in bursts."
You can do something simple on your end like spacing out your looped requests on a 0.33 second delay. Or if you want to be fancy, route all requests through a rate-limiting algorithm that allows bursting like token bucket algorithm. I found at least one python implementation.
from coinbasepro-python.
I feel like I need to necro this issue... throttling is not possible on paginated endpoints as _send_paginated_message contains a generator that does not check the result for 429 response or rate limit error message. In order to use this library with paged results that method at least should be respectful of rate limits.
` def _send_paginated_message(self, endpoint, params=None):
""" Send API message that results in a paginated response.
The paginated responses are abstracted away by making API requests on
demand as the response is iterated over.
Paginated API messages support 3 additional parameters: `before`,
`after`, and `limit`. `before` and `after` are mutually exclusive. To
use them, supply an index value for that endpoint (the field used for
indexing varies by endpoint - get_fills() uses 'trade_id', for example).
`before`: Only get data that occurs more recently than index
`after`: Only get data that occurs further in the past than index
`limit`: Set amount of data per HTTP response. Default (and
maximum) of 100.
Args:
endpoint (str): Endpoint (to be added to base URL)
params (Optional[dict]): HTTP request parameters
Yields:
dict: API response objects
"""
if params is None:
params = dict()
url = self.url + endpoint
while True:
r = self.session.get(url, params=params, auth=self.auth, timeout=30)
results = r.json()
for result in results:
yield result
# If there are no more pages, we're done. Otherwise update `after`
# param to get next page.
# If this request included `before` don't get any more pages - the
# cbpro API doesn't support multiple pages in that case.
if not r.headers.get('cb-after') or \
params.get('before') is not None:
break
else:
params['after'] = r.headers['cb-after']`
from coinbasepro-python.
I agree, I'm hitting this pretty often now on the get_fills endpoint. @danpaquin can we reopen?
from coinbasepro-python.
Related Issues (20)
- AuthenticatedClient.place_stop_order Returning Invalid HOT 3
- pro.coinbase.com/orders - request timestamp expired HOT 1
- get_account-is returning '1inch' as my main currency instead of USD HOT 1
- convert_stablecoin not updated in pip HOT 2
- Retrieve high, low close price over last hour HOT 1
- Transfer History Ticker label HOT 1
- Problem with the Order Entry's Effect on the Available Balance
- Orders simply not placing? HOT 1
- AttributeError: partially initialized module 'cbpro' has no attribute 'public_client' (most likely due to a circular import) HOT 1
- 'pip install cbpro' does not install the same version as 'pip install git+git://github.com/danpaquin/coinbasepro-python.git' HOT 4
- Activating stop orders before it hits the limit price HOT 1
- get_product_trades method hangs
- Trailing Stop - Dynamically updating existing positions HOT 2
- Cannot create PublicClient with Python 3.10
- Incompatible problens
- Withdraw Route to Coinbase Account is Incorrect
- websocket connection resets every two minutes HOT 1
- Coinbase API change HOT 3
- Dependency issue with Six version 1.10 vs 1.12 HOT 1
- Repo does not have option to view transfer ID's.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coinbasepro-python.