Searching Data

You can search the quandl database using the quandlsearch function. This function supports one positional argument (the string you are searching for), and four keyword arguments:

  • page, which is the page returned by the search (default is 1);
  • results, which is the number of the results per-page (default is 20);
  • quiet, which indicates whether the function prints information on screen or not (default is false);
  • format, which is the datatype where output is aggregated (default is "DataFrame", but you can also use "Dict").
julia> df = quandlsearch("GDP USA", results=30)
Returning 30 results of 746200 from page 1
30x5 DataFrame
|-------|-----------|-------------|---------|
| Col # | Name      | Eltype      | Missing |
| 1     | Code      | ASCIIString | 0       |
| 2     | Name      | ASCIIString | 0       |
| 3     | Frequency | ASCIIString | 0       |
| 4     | From      | ASCIIString | 0       |
| 5     | To        | ASCIIString | 0       |

julia> names(df)
5-element Array{Symbol,1}:
 :Code
 :Name
 :Frequency
 :From
 :To

julia> df[:Name]
30-element DataArray{ASCIIString,1}:
 "United States: GDP (current LCU)"
 "United States: GDP growth (annual %)"
 "United States: GDP deflator, LCU"
 "United States: GDP (constant LCU)"
 "France: GDP, current US\$, millions"
 "Netherlands: GDP Potential, constant US\$, millions"
 "India: GDP Discrepancy, current US\$, millions"
 "Lesotho: GDP Discrepancy, current US\$, millions"
 "Vanuatu: GDP (constant 2000 US\$)"
 "Fiji: GDP, current US\$, millions"
 
 "Czech Republic: GDP (current US\$)"
 "Grenada: GDP (current US\$)"
 "Mauritania: GDP (current US\$)"
 "Ethiopia: GDP, current US\$, millions"
 "South Africa: GDP, constant US\$, millions"
 "Pakistan: GDP (constant 2000 US\$)"
 "Albania: GDP Discrepancy, constant US\$, millions"
 "Nepal: GDP (constant 2000 US\$)"
 "Mongolia: GDP Discrepancy, constant US\$, millions"
 "United States: GDP Discrepancy, constant LCU, millions"

A dictionary datatype is also supported.

julia> s = quandlsearch("GDP USA", format="Dict"); # Here 's' is an array of dictionaries

julia> s[1] # This first dictionary looks ugly on REPL
["from_date"=>"1960-12-31","code"=>"USA_NY_GDP_MKTP_CN","name"=>"United States: GDP (current LCU)","source_code"=>"WORLDBANK","id"=>2582933,"updated_at"=>"2014-05-17T12:32:40Z","private"=>false,"description"=>"GDP at purchaser's prices is the sum of gross value added by all resident producers in the economy plus any product taxes and minus any subsidies not included in the value of the products. It is calculated without making deductions for depreciation of fabricated assets or for depletion and degradation of natural resources. Data are in current local currency.\nGDP (current LCU)","urlize_name"=>"United-States-GDP-current-LCU","display_url"=>"http://api.worldbank.org/countries/USA/indicators/NY.GDP.MKTP.CN?per_page=1000","column_names"=>{"Date","Value"},"source_name"=>"World Bank","frequency"=>"annual","type"=>nothing,"to_date"=>"2012-12-31"]

julia> s[1]["name"]
"United States: GDP (current LCU)"

julia> s[1]["updated_at"]
"2014-05-17T12:32:40Z"