Total Supply api for Coinmarketcap listing - api

I'm looking at updating the Coinmarketcap listing for a token on the Solana blockchain.
For Total Supply Coinmarketcap asks to provide:
"API endpoint that displays ONLY 'Total Supply' as a numerical value (e.g. http://chainz.cryptoid.info/grs/api.dws?q=totalcoins)"
How would I go about doing this?

The getTokenSupply endpoint on the Solana JSON RPC will get you close: https://docs.solana.com/developing/clients/jsonrpc-api#gettokensupply
Unfortunately, it isn't a normal REST API endpoint, so it requires some parameters, and it provides JSON output. In the output, you'll need the uiAmountString. You may need to add in something to proxy the call and extract the value if CoinMarketCap is so stringent.

Related

Data Factory Dynamic Content in REST API Call

I'm making an API call, where once I'm authorised I have to use a security token as part of subsequent calls. I'm using the variable "SecurityToken" to store the token.
Also as part of the call I need to pass a date parameter, which is the date from 14 days ago in YYYY-MM-DD format.
I've built this formula but it will not run, it stops the whole pipeline from running
Dynamic Content:
#concat('https://MyAPIUrl/api/daily/UK?key=',variables('SecurityToken'),'&date=formatDateTime(addDays(utcnow(),-14),'yyyy-MM-dd')'&currency_type=GBP&use_website_rounding=FALSE')
Error:
{"code":"BadRequest","message":null,"target":"pipeline//runid/8990bb14-27f8-43e5-b7c0-1741204ff645","details":null,"error":null}
Can you try this
#concat('https://MyAPIUrl/api/daily/UK?key=',variables('SecurityToken'),'&date=',formatDateTime(addDays(utcnow(),-14),'yyyy-MM-dd'),'&currency_type=GBP&use_website_rounding=FALSE')

Getting token and contract information using Nethereum

I am looking at this staking contract (pancake swap):
0x73feaa1ee314f8c655e354234017be2193c9e24e
and it's token (cake):
0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82
you can find a summary here:
https://bscscan.com/token/0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82?a=0x73feaa1ee314f8c655e354234017be2193c9e24e
On bscscan, I can get the following information:
price of token $12.54
market cap $2.9b
supply 231m
holders 137k
balance 88m (cake)
With nethereum, when I call:
web3.Eth.GetBalance.SendRequestAsync
I get:
with staking contract address: 479430015101300880
with token address: 3459819507903896496
and I'm not sure what the units are, nor how to map this to the information from bscscan.
I'm trying to get both the token value, but also what is the balance in the contract and I can't seem to find a way to do this.
so I looked at the nethereum playground and found an example dealing with ERC20 tokens, but when I put my addresses in it, the output is 0 and absolutely no error message, etc.

How to call multiple quotes from IEX Cloud API

I am trying to use IEX Cloud to get stock quotes for multiple stocks with one API call.
Here is my api call for Apple,Facebook, and Tesla. What am I doing wrong?
https://cloud.iexapis.com/stable/stock/market/batch?symbols=aapl,fb,tsla&types=quote?token=MY_TOKEN_HERE
The Error Message returned from the API is this:
"types" required with a valid value
I think the main problem was question mark between 'quote' and token. It should be '&' instead. I replicated your error with question mark, but with & it works just fine.
Here is what works for me: https://cloud.iexapis.com/v1/stock/market/batch?&types=quote&symbols=aapl,fb,tsla&token=YOUR_TOKEN_HERE
if you want to retrieve just the latest price, you can use following call:
https://cloud.iexapis.com/v1/stock/market/batch?&types=price&symbols=aapl,fb,tsla&token=YOUR_TOKEN_HERE
You can learn more at this link: How do I query multiple symbols or data types in one API Call? (for production you use cloud.iexapis.com instead of sandbox)
as of 2nd-July-2022,
This is how I structured my URL for a batch request.
const tickerArray = ["AAPL", "META", "GOOGL", "TSLA"];
`https://cloud.iexapis.com/v1/stock/market/batch?symbols=${tickerArray.toString().toLowerCase()}&types=quote&token=${process.env.IEXCLOUD_API_KEY}`

SoftLayer REST API get Bandwidth Data By Date

I have a question regarding the use of the getBandwidthDataByDate request using the SoftLayer REST API.
In the documentation it lists 3 parameters for this request, but it's a GET request. Does anyone know how to make this request and/or have an example?
https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/getBandwidthDataByDate/'device_id'.json
I'm not sure where to add the parameters here.(startDateTime, endDateTime, networkType)
And what does the dateTime object look like?
Thanks
This is a POST request, so you need to pass the parameters in "Payload" (I'm using Advanced REST client for Chrome).
Try the following REST request:
https://$user:$apiKey#api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/$device_id/getBandwidthDataByDate
Method: Post (Copy the below code in "Payload")
{
"parameters":[
"2016-03-10T00:00:00",
"2016-03-15T00:00:00",
"public"
]
}
Note: Replace $user, $apiKey and $device_id with your own information
References:
SoftLayer_Virtual_Guest::getBandwidthDataByDate

getContentServiceInfo1 returns truncated data regardless of reqSpecifier

Calling the getContentServiceInfo1 REST API seems to return the same data regardless of provided reqSpecifier and notrim values. I am using this call as part of the refresh account flow to determine whether the service requires MFA. Is there another call that I can make to achieve the same thing?
I noticed that the values accepted for reqSpecifier are essentially binary bit masks but providing the flag as 10000000, or even 0b10000000 for that matter, instead of 128 does not change the results. What value and value type should I be providing for reqSpecifier to get more than the basic level information? Relevant request and return information when using this API call for E*Trade is below.
Request (cobrand token is omitted):
{"cobSessionToken":"",
"contentServiceId":24,
"reqSpecifier":128,
"notrim":true}
Response (this is always the response I get unless I provide arguments that result in an error):
{"contentServiceId":24,
"siteId":744,
"containerInfo":{"containerName":"stocks","assetType":1}}
This response comes when you pass "notrim" value as "false", if you are passing it "false" then please pass it as true. It should work.