Articles on: General questions

How to use external APIs with the JSON connector?

How to use external APIs with the JSON connector?



First, select the JSON/CSV/XML connector in Dataslayer.

Next, find the API you want to use at this link: https://dataslayer.ai/list-of-public-apis (you can also use other public APIs if you have the link).

For this example we will use the CoinStats API. Inside the Dataslayer, in the URL field, copy the "base endpoint" link, (in this case, https://api.coinstats.app/).



Next, copy the "popular endpoints" link you are interested in, deleting the first slash, so that it does not appear duplicated when joining the previous link. (In this case, we add to the previous url " /public/v1/coins", and the resulting url would be https://api.coinstats.app/public/v1/coins).

Enter this link in the Dataslayer "Url" field. It is not necessary to fill in the rest of the fields to obtain the data. When you click on "generate table", the result will be displayed in Dataslayer.



Technical information: The JSON (or other type) call simulates a CURL (or postman) call. If it is necessary to send arguments to it, they must be added in the url. If it is a POST type, the parameters must be added in the request (besides adding in the header the format in which it is given) and if it is also necessary to use credentials, they must be added in the header.
If you make the call with postman you can check how the code of the call would look like, because you have to put the same.

Updated on: 28/09/2022

Was this article helpful?

Share your feedback

Cancel

Thank you!