• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Crypto Currency
  • Technology
NEO Share

NEO Share

Sharing The Latest Tech News

  • Home
  • Artificial Intelligence
  • Machine Learning
  • Computers
  • Mobile
  • Crypto Currency

Python: I Have Tested Quandl API and How to Get Real Estates & Economics Data in One Line of Code.

December 16, 2020 by systems

As explained above, if you are an investor, you must be aware that in 2020 & 2021, one of the trendiest commodity is Gold.

Indeed, Gold is correlated negatively to economic growth, and in time of the pandemic, that has been a lucrative investment for multiple investors.

Now, the question is, how to get robust and trustful Gold price data for a specific local currency (either if you are American, Canadian, Indian, British … )?

Let’s analyze now how you can hack it using Quandl.

Quandl API is working using a tick code & an API key, which can be accessed for free. (All explanations in the tutorial videos in the last part, plus a gift). The user will need to insert the following 3 arguments (tick code, start & end date) and type the following code structure in order to request data:

quandl.get(tick code, start_date, end_date)

Now that we got the structure, the first step will consist of researching “Gold Price”, in the research bar at the top left corner.

Here the location of the research bar.

Once the research has been performed, we will select a free dataset of our choice.

I am going to use the dataset provided by the London Bullion Market Association for the test. According to Quandl, LBMA is an international trade association in the London gold and silver market, consisting of central banks, private investors, producers, refiners, and other agents & an official data provider.

The tick code associated is “LBMA/GOLD”. So, let’s type the following line of code:

The line of code above will request data for Gold.

And here is the output:

Expected output using the line of code above

Now if you want to plot your data:

Gold/USD & Gold/GBP price evolution between 2014 and 2020.

You can have the full code explanation in the video tutorial(Part III, minute 8:25 to 11:20).

Overall, the data looks accurate (less than 1$ difference) if you compare it to Bloomberg.

The first test is positive.

The second test, how can we upload and request US stock exchange data for investment and algorithmic trading?

If you want to learn how to start with algorithmic trading with Python and impress your colleague at work or university. I highly recommend the following course, most of the code has been taken from this source:

Similarly to the request above, we are going to start by searching for market data.

We will choose wiki continuous future as a data source and request to get data for GOOGLE. The ticker for this request is “WIKI/GOOG”. So, let’s type the following line of code:

The line of code above will request stock data for Google.

Once we have executed the line of code above, here is the output:

Expected output dataset

Boom! We got the data, plus extra information regarding split ratio, volume & dividends.

My opinion:

The possibility to download market data through Quandl API is not the most efficient. I have tested a couple of other API in the past, such as Yahoo Finance or Bloomberg, and the difference is important. You can find the full test below and see by yourselves the difference:

However, I like the fact that Quandl is providing the possibility to get dividends day and the amount. As an investor and algorithmic trader that an excellent point to add to our model.

Now, that we have tested the market data import, let’s jump to the last test.

Did you ever ask yourselves if your monthly rent is over or underpriced? Or based on your area, if your one-bedroom apartment bought was overpriced?

In this section, we are going to explore how to download local real estates data using Quandl.

Similarly to what we have done previously, you will need your ticker code. To find it we are going to search “Zillow New York” in the search bar at the top left corner.

Once you have chosen the New-York’s borough data that you want, you should type the tick code and execute the following line of code:

The line of code above will request data for Harlem and midtown NYC.

In the line above we are requesting the data for a one-bedroom apartment in Harlem vs Manhattan midtown. (Full explanation in the video below. Minute 12:20 to 17:50)

A full live test of Quandl API explained.

And here is the final output of the price of a 1 bedroom apartment of 2 New York borough over-time:

Expected output plot using PlotLy

My conclusion:

I hope you enjoyed this test; I took a lot of fun to decorticate this API. You can go further using Quandl API and test it yourselves.

Overall, Quandl has a lot of strength and disadvantage. The aim behind this article was to propose you to discover an API which you will be able to use in the future.

I am teaching data science to my son sometimes, and I like using Quandl because you can get a clean and official dataset in one line of code. Suppose you want to test your Artificial Intelligence and Machine Learning models. In that case, it can be an excellent way to have the necessary randomized data (mainly for a neural network which require a massive input dataset).

Furthermore, the types of data are wide. If you are working in medical, you can request plenty of data concerning healthcare, or if you are a statistician, you can explore data provided by the government on this platform to enhance your analysis.

If you want to know more about API’s test and how to code an algorithm for trading, I recommend the following youtube channel:

https://www.youtube.com/channel/UCZorZ8KWmTON7aO84JJBwlQ?

Filed Under: Artificial Intelligence

Primary Sidebar

Making machine learning trustworthy for the real world — with reliable AI

Pixel Launcher ‘Grid’ icon density feature missing for several users

Making machine learning trustworthy for the real world — with reliable AI

Robots At Work!

Smart vaccine scheme quick to curb rabies threat in African cities

Footer

  • Privacy Policy
  • Terms and Conditions

Copyright © 2021 NEO Share

Terms and Conditions - Privacy Policy