Getting Data from an API – dashdash Essentials

Getting Data from an API – dashdash Essentials


One of the great things about dashdash is
that it allows you to interact with any API. But what exactly is an API? An API or an “Application Programming Interface
is a set of rules and functions that allow you to interact with other online services
by sending and receiving data in a structured way As of today, there are over 50,000 public
web APIs out there, as well as countless private ones. You can use APIs to perform many tasks—anything
from getting stock prices and sending messages to managing databases, or even controlling
your home devices. dashdash offers three main functions that
allow you to interact with any API you have access to: GET, POST, and PUT, which are HTTP
web requests. Let’s start with the GET function—we’ll
explain POST and PUT in another video. The GET function performs a request on a URL
and returns the server response. As a first parameter, you need the API URL. As a second parameter, you can pass an authorization
key as a header, if this is required, and you’re good to go! You will find all the information you need
about the URL you want to call and the authentication of your request in the API documentation. After you send a request to the API, its server
sends back a data file that dashdash stores in the cell. It’s displayed in JSON format which you can
easily view with our Data Explorer. Then, parse for the information you need. Some API responses contain arrays, which are
objects with several attributes that you’ll want to display in a spreadsheet table. For example, a list of companies and their
information or exchange rates for different cryptocurrencies. You can automatically map out all the array’s
data or specific parts of it by using the INSERT_DATA function. This function takes a JSON object and instantly
maps out the information inside the object matching the selected headers. Whenever you use the GET request again, it
will create a data log. But what if the data constantly changes? Or if you wanted to add to or edit it without
having to insert new rows? That’s where the UPDATE_DATA function comes
into play. It’s similar to INSERT_DATA, but it also
takes a list of keys, which are the reference values to match with. It will then check if there are any changes
in the data in order to decide if new data will be added or just updated. Now that you’ve learned what an API is,
how to use a GET request in dashdash, and how to get the data you need from a JSON format
into spreadsheet cells. You can now start working with any API you
want!

Leave a Reply

Your email address will not be published. Required fields are marked *