API

Hi can I take information from other webseite with Api. And how can i learn it?

what website. tell me more

I want take information from coinmarketcap i try it ,but i dont unterstand how i should do it. I want do a table with the information from coinmarketcap. I try it with google sheets but it doesn’t uptading and its look bad.

Hi Musti,

You can access third party sources by using fetch api.
Find a step by step tutorial here .

Hey
First you must find and use their API from Coinmarketcap. I look and it’s available in the footer of their site. The API Endpoint that you will need to read from is located here: https://api.coinmarketcap.com/v1/ticker/.

Then if you follow the guide Ido sent you you will do something like below.

export function buttonFetchRate_click(event) 
{  
var url = 'https://api.coinmarketcap.com/v1/ticker/';  

fetch(fullUrl, {method: 'get'})     
  .then(response => response.json())     
  .then(json => console.log(json);); 
}

But if you want all of the items from Coinmarketcap to be inserted in Data Collection and then updated you must create a forEach loop for the JSON items you get back. Then inside that loop you need to query and check if currecy / item exists and if it exists UPDATE or INSERT.

You can use wixData to insert and update and query.

Then you have that done you just drag out a dataset and connect a table and voila!

Can you explain a bit more how to do this because the code you mentioned above is on backend for sure but if i want to call in repeater at front end & taking user input & save it to the database so api will call the url endpoint from the database field how can i do it i hope you understand.

Process i want to execute:

User fill the form in database (Like: id) > we will call the api items in repeater via database field to show on repeaters