APIs
Here we'll see the information rather than transfer any info as a csv file, we are going to to download the data using the APIs. The aim of this method is to realize expertise with getting, extracting data & which one will be an automation process.
API is associate signifier that stands for application programming interface. that one offer a regular approach for 2 applications to communicate each others. This case, the applications act with one another communication without interacting with server of a business.
If you needed to get data directly from the globe Bank’s server, you’d need to know some information releated to server like credentials as well as setting, IP white listing etc.,which one can be a security risk for the globe Bank. And if the globe Bank ever migrated its knowledge to a brand new system, you'd need to rewrite all of your code once more. The API permits you to execute code on the globe Bank server while not obtaining direct access & we tend to no have to be compelled to recreate our data once more..
Before APIs
Before there was a scraping. folks would transfer html directly from a web site then break down the results programatically. This method could be a legal gray area. One reason that APIs became in style several firms might give information to users and discourage web scraping.
Here ar some articles regarding the lawfulness of net scraping.
Now a days many organization have their public facing APIs including Facebook, Twitter, Google and Pinterest youtube etc. we can easily pull/get data from these organization API to create our own Database.
In this article, you’ll get practice using Python to pull data from the World Bank indicators API.
Here are some links to information about the World Bank indicators and projects APIs if you want to learn more:
Using APIs
In general, you access APIs via the web using a web address. Inside the web address, you just specify the data that you want. Once you need to read an API's documentation then you can easily understand the process for API request. Some APIs require to send login credentials when we request an API call which one is a part of our request.
The World Bank APIs are public and do not require login credentials.
With he Python library once we requests By using APIs it's make the easy process.
In general, you access API's using web among the online address, you specify the information that you just need. to get data the way to format the web address, you need to browse an API's documentation. Some APIs require to login cedentials as a part of your request. the globe Bank APIs are public and don't need login credentials.
The Python requests library makes operating with Apis comparatively straightforward.
Example Indicators API
Here we have provide an example to request the data from world bank by API call. in line with the documentation, you format your request uniform resource locater like:
http://api.worldbank.org/v2/countries/
+ list of country abbreviations separated by ; + /indicators/
+ indicator name + ?
+ options
where options can include
- per_page - number of records to return per page
- page - which page to return - eg if there are 5000 records and 100 records per page
- date - filter by dates
format - json or xml
0 Comments