#π Please read: If somebody understands numpy and logging in API with a token to acess json informati
89 messages Β· Page 1 of 1 (latest)
@peak perch
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Please actually ask your question, nobody will know if they can help you without seeing the actual problem
Hello, i really need to call somebody and share screen it's too complicated for me to even formulate
I feel extremely dumb trying to get to the bottom of the matter
I can only visually represent what I am struggling with.
If you can't write it in text, why do you think you'll be able to put it in spoken words? Both are words. Just write down what you'd say
First, start with the error about the token and api
Okay I apologise, so I need to acess valuable information for my python program, through an API (which is given by the site) . Now I have the AUTHORIZATION_ID + the correct headers. The only problem is that i have wrong parameters which causes the site give me back the ERROR 500
I tried for multiple hours playing around the paramaters but still can't manage to fix them myself..
Please show the code, but do not share your token/ids
!code
We don't help over dm, just paste here
it's too long
I Don't have paid nitro and it doesn't allow me to share with you
there's some sort of limit
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
@zinc yacht @wanton warren @quartz sand
The problem is in the parameters I there seems to be an issue
Everything else is correct.
I want to be able to resolve the issue myself but I have to know how to acess the link through a browser so i can see the parameters myself.
I'd say to check the docs and make sure the auth header is correct. Oftentimes that header is not some "id", but actually has a word before it, like "Bearer token_here"
Also, don't add useragent to try mimic a browser - it's an api, it shouldn't care if you access it from code. Less headers is better. Normally you'd only send auth and accept and leave the rest to defaults... Especially since you add ad-tracking headers as well :x
Hello Nicky yes the bearer token i have it, i just put it hidden
So @quartz sand your suggestion is removing the parameters
Where are the docs for this api?
'authorization': f"Bearer {AUTHORIZATION_ID"
Do you have the βBearer β?
Yes ofc !
It does not appear to be public
π
Whats the body of the 500 response?
Is there an error message in there?
Internal server error.
But I am sure everything is working probably I am just giving it the wrong parameters
I don't know how to check the parameters π¦
here is the entire code with Bearer
No, that's what 500 means.
Before you do r.raise_for_status() please do print(r.text) and post that text here
Never ever post your tokens publicly
sorry im sorry
'''py
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Internal Server Error</pre>
</body>
</html>
Process finished with exit code 1
'''
Hey @peak perch!
It looks like you are trying to paste code into this channel.
You seem to be using the wrong symbols to indicate where the code block should start. The correct symbols would be ```, not '''.
Here is an example of how it should look:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
You can **edit your original message** to correct your code block.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Internal Server Error</pre>
</body>
</html
Process finished with exit code 1
Btw, that token doesn't look like bearer token. Bearer for basic auth is encoded with base 64
Nicky can you please talk with me
I'm talking with you now
If you remove the header and encode the bearer properly (e.g. via requests' auth), you will get error 403 instead of server error
But 403 still says the token is wrong
Okay sorry i don't want to waste your time nicky could you just tell me a good tutorial video on where i can learn
a way to fix this issue
Without the api docs you probably won't be able to fix it, because you don't even know what you're doing wrong
But for api itself: if you know anything about restful, requests' docs are quite nice.
but Nicky it does work - https://paste.pythondiscord.com/BVRA
check this > when it runs it spits out the needed information
however when I change this line: https://api.tracksino.com/crazytime_history to https://api.tracksino.com/lightningroulette_history the token doesn't work anymore
So that's why I assumed that it needs different parameters , the only thing i don't know is how to access these parameters
Open the api docs. Since you have the token, you have to have access to the docs
If you don't have access to the docs, it means you shouldn't have tried to mess with the api at all
Where did you get that token?
1 year ago I paid a person to create the code for me
He said that the API is free of use
And now one year later the only thing i want to change in the code is this line: https://api.tracksino.com/crazytime_history to https://api.tracksino.com/lightningroulette_history
but it gives me an error.
Before, @wanton warren said the docs are just not publicly available but since you got the token, we assumed those are available for logged in users and that's how you got the token as well.
The website also doesn't appear to have a ToS
But the fact that api is not public at all, it means it's api is for internal use only.
Api links being visible doesn't mean they're open to public use, the links have to exist for the website itself to function
Also, the first error 500 you posted was for the first link, not changed link :x
I made a mistake - it's for the second link
the first one spits out the needed information
It's not, because after you posted the token, I copied it and also got 500 for the first link. :x That's why I said it seems to fail with wrong format of the token
However i need the same code for a different game history, I thought it would work since it's provided by the same site but i suppose the parameters are wrong
While for correctly encoded header (with base64) it returns 403 instead, not internal server error
okay Nicky can i ask you one question please
sorry for wasting your time
Do you know a good tutorial video on how to check those json texts in site API
and using the token through networking in chrome
Seriously I don't know what to even type in the search bar to start learning how to fix my issue
!rule 5 as I said, the website doesn't have ToS but from all the signs it appears the api wasn't meant to be used by users, so it falls under this rule
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
but the boy who made the code said nothing illegal doing this i asked him wow
then he lied to me
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.
π Please read: If somebody understands numpy and logging in API with a token to acess json informati