To ping the API and get a trust score for the smart contract with address 0XXXX, use the curl command in terminal. Once that command is entered, it will return a json record.
Toggle between the tabs to see instructions in Python as well as JavaScript.
Shell Python JavaScript
Copy api_key=ofe86o+eAPm5ruMjFQJbesbE9HnjqCT2
curl --header "X-Api-Key: $api_key" "https://api.fimio.xyz/address?address=0xe42cad6fc883877a76a26a16ed92444ab177e306"
Copy import requests
headers = { 'X-Api-Key' : 'ofe86o+eAPm5ruMjFQJbesbE9HnjqCT2' }
address = '0xe42cad6fc883877a76a26a16ed92444ab177e306'
url = "https://api.fimio.xyz/address?address="
final_url = url + address
response = requests . get (final_url, headers = headers)
print (response.content)
Copy / requirements to run Fimio API using Javascript
//npm install node-fetch@2
//const fetch = require("node-fetch");
const fetch = require ( "node-fetch" );
const url = "https://api.fimio.xyz/address?address=" ;
const address = '0xe42cad6fc883877a76a26a16ed92444ab177e306'
const url_final = url + address
const apiKey = 'ofe86o+eAPm5ruMjFQJbesbE9HnjqCT2' ;
fetch (url_final , {
headers : {url_final ,
'X-Api-Key' : apiKey
}
})
.then (response => response .json ())
.then ((data) => console .log (data))
.catch (error => {
// handle the error
console .log ((error))
});