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

Problem with InfoAPI from example file 'DarwinAPIClassesExample.py' #3

Open
manugirla opened this issue Jan 21, 2022 · 6 comments
Open

Comments

@manugirla
Copy link

Good morning, I'm trying the example downloaded from https://github.com/darwinex/darwinexapis/tree/master/darwinexapis/EXAMPLE_SCRIPTS, named 'DarwinAPIClassesExample.py'.
I'm facing the following problem:
**[INIT] - Creating AUTH creds...
[INIT] - Access token will be created again at 1642757397.0541043 UNIX timestamp
[DarwinInfoAPI] Getting first 50 DARWINs..
[DECORATOR] - The expiration time has NOT reached yet > Continue...
**** FULL URL ENDPOINT **: https://api.darwinex.com/darwininfo/2.0/products?status=ACTIVE&page=0&per_page=50
<Response [403]>
{"fault":{"code":900908,"message":"Resource forbidden ","description":"Access failure for API: /darwininfo/2.0, version: 2.0 status: (900908) - Resource forbidden "}}

In particular, I'm trying this slice of code:
darwinUniverse = darwinexInfo.Get_DARWIN_Universe(_status='ACTIVE', _iterate=True, _perPage=50)
pprint.pprint(darwinUniverse)

I have provided the authorization tokens newly created from https://www.darwinex.com/data/darwin-api, but the problem remains.
AUTH_CREDS = {'access_token': 'a5d75de1-7212-3427-a29a-2f38be8cd8e0',
'consumer_key': 'GgkHUcgExTgcJ_rAlpar2Ziki9Ia',
'consumer_secret': 'XJvbUKZWLsTruqxSPxRdfsmQSF8a',
'refresh_token': '6aa3cd7c-b3de-3819-93b5-3f47f428e1f6'}

Could you please help me?
Thank you for the continuous support and regards,
Manuel Girlanda.

@manugirla
Copy link
Author

I have also tried to follow the suggestions on the similar topic closed on 14 Sept. 2020 but the problem still remains

@marticastany
Copy link
Collaborator

Hi @manugirla , just created a pull request with the issue about renewing the access token solved. Hope they accept the merge soon. If not, DM me and I'll explain you how to fix it. Regards!

@manugirla
Copy link
Author

manugirla commented Aug 20, 2022 via email

@xxoommuu
Copy link

xxoommuu commented Oct 17, 2023

I had the same issue. Could some share how to fix it? @marticastany

`df = darwinexInfo.Get_Historical_Quotes(["THA"])
[DarwinInfoAPI] Getting Quotes for DARWIN 1 / 1: $THA

[DECORATOR] - The expiration time has NOT reached yet > Continue...
**** FULL URL ENDPOINT ****: https://api.darwinex.com/darwininfo/2.0/products/THA/history/quotes
<Response [403]>
{"fault":{"code":900908,"message":"Resource forbidden ","description":"Access failure for API: /darwininfo/2.0, version: 2.0 status: (900908) - Resource forbidden "}}
[ERROR] Something went wrong while looking up $THA
Exception Type ValueError. Args:
('Length mismatch: Expected axis has 1 elements, new values have 2 elements',)`

@ChenIvy
Copy link

ChenIvy commented Oct 19, 2023

Hi everyone,

Thanks for leaving the note, this error can be fixed using version 2.1: https://api.darwinex.com/store/apis/info?name=DarwinInfoAPI&version=2.1&provider=admin .
@xxoommuu
Best regards.

@xxoommuu
Copy link

Hi everyone,

Thanks for leaving the note, this error can be fixed using version 2.1: https://api.darwinex.com/store/apis/info?name=DarwinInfoAPI&version=2.1&provider=admin . @xxoommuu Best regards.

THANKS. IT WORKS!

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

4 participants