Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3/trades: pagination parameters (before or after) not working #183

Open
rakewell opened this issue Feb 26, 2020 · 1 comment
Open

v3/trades: pagination parameters (before or after) not working #183

rakewell opened this issue Feb 26, 2020 · 1 comment

Comments

@rakewell
Copy link

I am using the path v3/trades to get my history of trades of which I can successfully see that I have done 3 trades!

In future cases where I have greater that 200 trades I am assuming the api will return the most recent 200 trades and i can then pass the 'before' pagination parameter to get trades before the most recent 200. I have successfully parsed the response header's BM-BEFORE value and have passed the value in the next request like this:

https://api.btcmarkets.net/v3/trades?status=all&limit=200&before=5259625877

Even though I only have 3 trades so far, I would have thought passing the before parameter on the second request would not return any records as there should be no records before the most recent 3 records that I have received. The API keeps returning all the records regardless of the before parameter I send. I have also tried using the 'after' parameter with the BE-AFTER value but this also return's all the records. With pagination, I don't necessarily know how many records I will receive so I need to stop the enumeration when the returned result set gives zero records but I can't do that since the API always returns records regardless of the pagination parameters. Can you please provide some help on this.

@martin-nginio
Copy link
Contributor

Hi @rakewell

Thanks for your feedback.

There has been a bug in the original implementation of pagination which has been resolved recently so if you are parsing and sending back before variable it should return correct results.

Thanks again for raising this issue.

Regards,
Martin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants