Eth2 Basic Metrics API Documentation

About the Crawler List API

Please feel free to query our crawler list API!
In this API you will be able to check our currently running crawlers. Please follow the following link to use it!

Go to Crawler List API »


Results If a crawler is standing a "1", it means that it is currently up.
If a crawler is standing a "0", it means that it is currently down.


                    

Sample response:

{

"frankfurt": "1",

"strasbourg": "1",

"london": "1",

"warsaw": "1",

"beauharnois": "1",

"singapore": "1",

"gravelines": "1",

"sydney": "1"

}

Use examples

Python
import requests
response = requests.get("http://migalabs.es/api/v1/crawler-list")
                            
Curl
curl -X GET "http://migalabs.es/api/v1/crawler-list"
                            
Javascript
const request = require('request');

request('https://migalabs.es/api/v1/crawler-list', { json: true }, (err, res, body) => {
    if (err) { return console.log(err); }
    console.log(body);
});
                            

About the Client Distribution API

Please feel free to query our client distribution API!
In this API you will be able to check the current client distribution of the five main Ethereum2 clients:

Prysm, Lighthouse, Teku, Nimbus and Lodestar.

Please follow the following link to use it!

Go to Client Distribution API »

Argument Type Values
crawler String Any of the crawlers from the above API:

"frankfurt" (default), "strasbourg", "london", "warsaw", "beauharnois", "singapore", "gravelines", "sydney"



Results The distribution of clients and the number detected


                    

Sample response:

{

"Grandine": 30,

"Lighthouse": 666,

"Lodestar": 3,

"Nimbus": 157,

"Others": 2,

"Prysm": 1630,

"Teku": 302

}

Use examples

Python
import requests
response = requests.get("https://migalabs.es/api/v1/client-distribution?crawler=london")
                            
Curl
curl -X GET "https://migalabs.es/api/v1/client-distribution?crawler=london"
                            
Javascript
const request = require('request');

request('https://migalabs.es/api/v1/client-distribution?crawler=london', { json: true }, (err, res, body) => {
    if (err) { return console.log(err); }
    console.log(body);
});
                            

Troubleshooting

CORS: Access-Control-Allow-Origin

If you are facing problems fetching data from one of our API endpoints and you are getting an error similar to Access-Control-Allow-Origin, you may be facing an origin header web policy issue. This basically means that you are not able to request a resource from a different domain, since you are already browsing through a served front end. This usually happens when the front end is the one fetching data, instead of requesting the backend to do this.
This happens because when you navigate through a front end, a header is set with the origin of the backend domain. In every other request you perform, this header is attached to verify where you come from. See a detailed explanation here.

But don't worry! We have a solution for this issue. There are two options to solve this problem:

Solution 1: Implement an API endpoint in the backend

You may expose an endpoint where your front end can make this query to. Then, your backend should implement a call to our API and return it to the front end. This way the call to our API is not done from an web environment, but it would be similar to a curl or wget, with no session involved, thus not having an initial "origin" header.

Solution 2: Implement a CORS proxy to receive such requests

So, if you a very minimalistic backend you may not be able to implement the previous solution. You may check the possibility to implement a CORS proxy. This proxy will basically receive the request from the front end, remove the origin header and query the external API, returning the result. You may follow this guide on how to do this.

Keep in mind that the front end should now query this proxy, instead of the external API.