Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
EffectiveAugust2016.Foradditionalsupportpleasecontact
connect@quandl.com.
ThisdocumentcontainsinterimdocumentationforQuandlsAPIforgeneraltabulardata.This
isadifferentAPIfromQuandlstimeseriesdataAPI.
Datatables
Generaltabulardataisstoredindatatables.Adatatablesimplyatableofdata;acollectionof
datastructuredasoneormorecolumnsandrows.
EverydatatableonQuandlcanbeidentifiedbyitsuniqueQuandlcodeviathe:datatableAPI
route.TheQuandlcodeforadatatableisthecombinationofitsvendor_codeandits
datatable_code.
GEThttps://www.quandl.com/api/v3/datatables/:vendor_code/:datatable_code/
HereisasimpleAPIcall:
curl"https://www.quandl.com/api/v3/datatables/ZACKS/FC.csv?api_key=YOURAPIKEY"XGET
ThiscallwouldreturntheFCdatatable,initsentiretyasaCSVdocument.(Youcanreplace
.csvwith.jsonor.xml).
FilteringParameters
Youcancustomizethedatatableobjectbeingreturnedbyaddingvariousfilterparametersto
yourquery.Filterparametersareuniquetoeachdatatable.Theavailablefilterparameterscan
befoundwithineachdatatablesdocumentationwebpage.Forexample,thefilterparameters
forZACKS/FCare:
Atablesfilterablecolumnsareavailableatitsmetadataroute,forexample:
https://www.quandl.com/api/v3/datatables/ZACKS/FC/metadata.json?api_key=YOURAPIKEY
MultipleValues
Ifyouwanttoselectmultiplevaluesforthesameparameter,youcanpassanarraytotheAPI
byincludingtheparameterfollowedbycommaforeachquery.
Forexample,ifyouwanttoqueryforthetickersAAPLandMSFTandreturncolumnsfortotal
revenueandcompanyname:
https://www.quandl.com/api/v3/datatables/ZACKS/FC.json?api_key=YOURAPIKEY&ticker=AAP
L,MSFT&qopts.columns=tot_revnu,comp_name
FilterModifiers
YoucanmodifycertainfiltersbyappendingamodifiertotheparameterinyourAPIcall.
Parameterfiltersaretabulatedbelow:
Forexample,tomodifytheparameterper_end_datetoretrievedatafromAAPLafterJan.1,
2015,usethefollowingAPIcall:
https://www.quandl.com/api/v3/datatables/ZACKS/FC.json?api_key=YOURAPIKEY&ticker=AAP
L&per_end_date.gt=20150101
ComplexExampleBreakdown
https://www.quandl.com/api/v3/datatables/ZACKS/FC.csv?api_key=YOURAPIKEY&ticker=AAPL,
MSFT&per_end_date.gt=20120101&per_end_date.lte=20141231&per_type=A&qopts.colum
ns=ticker,per_end_date,tot_revnu
https://www.quandl.com/api/v3/datatables/ APIendpoint
ZACKS/FC QuandlCode(VendorZACKS,tableFC)
.csv Returncsvformat
api_key=YOURAPIKEY Authentication
&ticker=AAPL,MSFT SelectallrowswithtickerAAPLorMSFT
&per_end_date.gt=20120101&per_end_dat Selectallrowswithper_end_dategreater
e.lte=20141231 than20120101andlessthanorequalto
20141231
&per_type=A Selectallrowswithper_typeequaltoA.In
thiscasereferringtoallannualrecords
&qopts.columns=ticker,per_end_date,tot_rev Showonlythecolumnsticker,per_end_date
nu andtot_revnu
Metadata
Todownloadthemetadataassociatedwithadatatable,append/metadatatoyourAPIrequest.
(Youcanreplace.jsonwith.csvor.xmlinthisrequest).
curl
"https://www.quandl.com/api/v3/datatables/ZACKS/FC/metadata.xml?api_key=YOURAPIKEY"
XGET
Exampleresponse:
<quandlresponse>
<datatable>
<vendorcode>ZACKS</vendorcode>
<datatablecode>FC</datatablecode>
<name>ZacksFundamentalsCondensed</name>
<descriptionnil="true"/>
<columnstype="array">...</columns>
<filterstype="array">
<filter>ticker</filter>
<filter>per_type</filter>
<filter>per_end_date</filter>
</filters>
<primarykeytype="array">
<primarykey>m_ticker</primarykey>
<primarykey>per_type</primarykey>
<primarykey>per_end_date</primarykey>
</primarykey>
<premiumtype="boolean">false</premium>
</datatable>
</quandlresponse>
OtherParameters
Therearefourgeneralparametersthatarecommontoalldatatables:
Overview
ThenewbulkdownloadAPIforDatatablesprovidesQuandluserswithatooltogenerate
customCSVfilesfromthedatacontainedinaDatatable.Thefilesarecreatedondemand
basedontheprovidedAPIparametersandaredeliveredasynchronously.
QuickExample
Note:thebelowexamplesmustalsoincludeavalidAPIkey(append
&api_key=YOUR_API_KEY)oranerrorwillbereturned.
AlldatafromZacksEquityPricesDatatableforAAPL,FBMSFTandAMZN
between1995and2005(requestedviaHTML)
https://www.quandl.com/api/v3/datatables/ZACKS/P?ticker=MSFT,AAPL,AMZN,FB&date.gte=1
9950101&date.lte=20151231&qopts.export=true
Note:YouwillonlygetaccesstoZACKS/PifyouaresubscribedtotheZEPdatabasewiththe
Zacks/Pdatatable.Ifnot,pleasesubstituteZACKS/Pwiththevendor/datatablecodethat
youaresubscribedto.
AlldatafromZacksFundamentalsCondensedDatatable(requestedvia
JSON)
https://www.quandl.com/api/v3/datatables/ZACKS/FC.json?qopts.export=true
Usage
APISignature
TousethebulkdownloadAPIfordatatables,simplyappendthequeryparameter
qopts.export=truetoanyDatatablesAPIrequest.Whenthisparameterispresent,ratherthan
returningdatasynchronouslyinpages,Quandlwillgenerateasinglefilecontainingallofthe
requesteddata,andreturnmetadatacontainingthelocationandstatusofthisfile.
TheAPIcanbeusedviaHTML,JSON,XMLorCSV.Thefollowingisanexampleresponsein
JSON:
{
"datatable_bulk_download":{
"file":{
"link":"https://duf9k3nptkna3.cloudfront.net",
"status":"fresh",
"data_snapshot_time":"2016060814:02:50UTC"
},
"datatable":{
"last_refreshed_time":"2016060722:53:19UTC"
}
}
}
AttributeDefinitions
file
linkThestringURLwherethefilecanbedownloaded,ornull,ifitisnot
present.
statusThestringstatusoftherequestedfile.Thepossiblevaluesare:
Freshthefileisavailableanduptodate
Creatingthefileisnotavailable,butitisbeingcreated
Regeneratingthefileisavailable,butitisoutofdateandanewoneis
beingcreated.
data_snapshot_timetheDateTimewhenfilecreationstarted.
datatable
last_refreshed_timeTheDateTimewhentheDatatablewaslastupdated.
ThegeneratedlinkdownloadURLisvalidfor2minutes.Ifyourlinkexpires,repeatyour
requesttotheAPItogenerateanewlinkdownloadURL.
Limits
UsersmustbeloggedintoaccessthebulkdownloadAPI.
Usersarelimitedtorequesting10bulkdownloadfileseveryhour.
Thegeneratedfilewillincludeonlythedatathattherequestinguserisentitledto.Ifyou
donothaveasubscriptiontothedata,yourfilewillincludeonlypreviewdata.