Skip to content

Instantly share code, notes, and snippets.

@AliAzizi
Created January 6, 2022 18:02
Show Gist options
  • Select an option

  • Save AliAzizi/b348bf70e2765bbaf82bf9561ce07da7 to your computer and use it in GitHub Desktop.

Select an option

Save AliAzizi/b348bf70e2765bbaf82bf9561ce07da7 to your computer and use it in GitHub Desktop.
CoinMarketCap Free Api - API key is not required

Using this API, you can get currency details from CoinMarketCap without an API key, including prices, logos, symbols, etc.

Please give it a star if you liked it ⭐️

https://api.coinmarketcap.com/data-api/v3/cryptocurrency/listing?start=1&limit=10000&sortBy=market_cap&sortType=desc&convert=USD&cryptoType=all&tagType=all&audited=false

⚠️ Use at your own risk! If you are able to support them, you can purchase an API key from this url: https://pro.coinmarketcap.com/signup/

Implementation For:

NodeJs - Axios
NodeJs - Request
PHP - CURL
Python - HttpClient Python - Http-Requests Dart - Http

var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://api.coinmarketcap.com/data-api/v3/cryptocurrency/listing?start=1&limit=10000&sortBy=market_cap&sortType=desc&convert=USD&cryptoType=all&tagType=all&audited=false',
  headers: { }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://api.coinmarketcap.com/data-api/v3/cryptocurrency/listing?start=1&limit=10000&sortBy=market_cap&sortType=desc&convert=USD&cryptoType=all&tagType=all&audited=false',
  'headers': {
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.coinmarketcap.com/data-api/v3/cryptocurrency/listing?start=1&limit=10000&sortBy=market_cap&sortType=desc&convert=USD&cryptoType=all&tagType=all&audited=false',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import http.client

conn = http.client.HTTPSConnection("api.coinmarketcap.com")
payload = ''
headers = {}
conn.request("GET", "/data-api/v3/cryptocurrency/listing?start=1&limit=10000&sortBy=market_cap&sortType=desc&convert=USD&cryptoType=all&tagType=all&audited=false", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests

url = "https://api.coinmarketcap.com/data-api/v3/cryptocurrency/listing?start=1&limit=10000&sortBy=market_cap&sortType=desc&convert=USD&cryptoType=all&tagType=all&audited=false"

payload={}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
var request = http.Request('GET', Uri.parse('https://api.coinmarketcap.com/data-api/v3/cryptocurrency/listing?start=1&limit=10000&sortBy=market_cap&sortType=desc&convert=USD&cryptoType=all&tagType=all&audited=false'));


http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
  print(await response.stream.bytesToString());
}
else {
  print(response.reasonPhrase);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment