How to make api get requests from dukascopy? - api

I have an api key but i'm not sure on how to make an get request using their api.
The documentation is a bit vague on how to format the url, any help is appreciated!
Documentation:
https://www.dukascopy.com/trading-tools/api/documentation/quotes

To use the API you just need to append your key in the URL like,
https://freeserv.dukascopy.com/2.0/?path=api/lastOneMinuteCandles&key={you_api_key}
Another example,
https://freeserv.dukascopy.com/2.0/?path=api/currentPrices&key={api_key}&instruments=EUR/USD,USD/JPY
You can use Postman, and should see some values come back (since my key is not valid, I got 401).

Related

OpenSea API returning null when i want to fetch my data

when i go to this link
https://api.opensea.io/api/v1/assets?asset_contract_address=0x892848074ddea461a15f337250da3ce55580ca85
It returns me some data i can use. But when i tried to fetch MY assets its not return any data from this link.
https://api.opensea.io/api/v1/assets?owner=0xA48Db0a225703b25ef95B863C1aa44929bBA7FDe
You can see my assets from this link
https://opensea.io/M1croNFT
How can i fetch my assets data with opensea api?
Most likely, your problem is that to use the api/v1/assets method. For this request you need to use the api key. This is written in the description of the method in the documentation.
GET api/v1/assets
Please Note: This API endpoint requires an API key to use. Please fill
out the API request form to obtain one. Request an API key
So, I think that if you get the key, you will be able to fulfill any request
Another option is to use queries in the test network - OPENSEA TESTNETS API. I tried to run a query there and got the correct response.

Drive API Update:

I use the following API call (with a valid key) and it has stopped working for one folder but still works for another. When it doesn't work I get an empty "files": [] response rather than a error. I can see that the update has impacted the folder that doesn't work but I don't understand why as they both look the same. I have tried appending &resourcekey=yyy but it makes no difference.
What can I do to fix the problem in either the Drive UI, the API credentials, or in the API call?
https://www.googleapis.com/drive/v3/files?q=%270B6Gv6UcT0j6HY2VKbzktd2F1Z2M%27+in+parents&spaces=drive&fields=files(mimeType%2Cid%2Cname%2CthumbnailLink%2CimageMediaMetadata%2Cdescription)&key=xxx
Thanks for your help.
Be sure to pass the following HTTP header:
X-Goog-Drive-Resource-Keys
along with your request, and set its value to:
[FOLDER_ID]/[FOLDER_RESOURCE_KEY]

How do I use/read an api documentation to send a simple request?

I know this is probably strictly case-specific, but I do feel like I encounter this problem a lot so I will make an effort to try and understand it better.
I am new to using APIs, but I have never succeeded in using one without copying someone's code. In this case, I can't even find any examples on forums, nor in the API documentation.
I'm trying to pull my balance value from my investment bank "NordNet" to scroll, amongst other things, on an Arduino display I've made. Right now I use python Selenium to automatically but "physically" login to NordNet and grab my balance from the DOM. As I'm afraid I might get "punished" for such botted behavior, and because the script is fairly high maintenance (as the HTML changes over time), I would obviously much rather get this information through NordNet's new API.
Link to NordNets API doc
Every time I try to utilize an API doc it's always the same, it looks easy, but I can never get it to work.
This time I tried to just play a little with the API before exploring further.
I use PostMan to send the simplest request:
https://www.nordnet.se/api/2
And I get a successful code 200 JSON response.
I then try to take it a step further to access my account data using this endpoint:
https://www.nordnet.se/api/2/accounts
For this one, I obviously need some authentication of some sort
The doc looks like this:
So I set my PostMan client up like this and get the response showcased:
I've put my NordNet login into the "Auth" tab as "basic auth" and I then see PostMan encrypts this info some way, in the "Headers" tab.
I'm getting an unauthorized response code and I have no idea why. Am I using PostMan wrong (probably)? Is the API faulty (probably not)? There is a mention of a session_id that should contain both password and username? Maybe something completely else...
I hope you can help
The documentation says to use session_id as username and password for that api ,
so try logging in and then get the session id (try with both sid and ssid) . from network tab and pass it as username and password for authorization .
sid- is for http and ssid for https i guess , try with both

What is profile in accept heading of wiki api request

For example, when you perform an call from summary api of wikipedia, there is this header in the request
accept:application/json; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/Summary/1.3.7"
What is the purpose of this particular bit. I would like to understand since the value changes when you, for example, use the VisualEditor or access the api with different mean.
profile="https://www.mediawiki.org/wiki/Specs/Summary/1.3.7"
This specifies the response format and provides convenient access to a human-readable documentation.
The URL in your header leads to nowhere, but https://www.mediawiki.org/wiki/Specs/Summary/1.3.0 does exist and is probably valid for 1.3.7 as well.

Github API - trying to access multiple pages of /users

I am playing around with Github's API and I noticed that they allow anyone to request all users that have signed up in chronological order.
https://api.github.com/users
http://developer.github.com/v3/users/
I was trying to get the second page but for some reason their pagination isn't working for me. I wasn't sure what I was doing wrong.
https://api.github.com/users?page=2
https://api.github.com/users?start_page=2
http://developer.github.com/v3/ Under "Pagination".
Anyone know the right way to do this?
Check out the returned HTTP headers for the https://api.github.com/users resource. Specifically, look for the Link header, which will look like this:
Link:<https://api.github.com/users?since=135>; rel="next", <https://api.github.com/users{?since}>; rel="first"
So, what you need to do is do an HTTP GET on https://api.github.com/users?since=135 to get the next page. After that, check the Link header again and you will get to the next page, etc. Also notice the provided URI template https://api.github.com/users{?since} which enables you to start at any id.