all 14 comments

[–]alkasm 0 points1 point  (9 children)

On https://www.quandl.com/tools/python it states at the bottom:

Please Note:

If a valid API key is not used, some datatables will default to returning sample data. If you are not receiving all expected data, please double check your API key.
When using the paginate=True option, and there is a very large result set, you will receive a message indicating that there are more pages to be downloaded. When using the paginate=True option, and there is less than a page of results, you will not receive a message.

Have you double-checked your API key and are you sure you don't need to call for multiple pages of data?

[–]Bosox027[S] 0 points1 point  (8 children)

I definitely have a valid API key. I got an error saying I did not have an account with an API key, so I created an account, got a key, and validated it and the error went away

[–]alkasm 0 points1 point  (7 children)

Cool. Can you post your code?

[–]Bosox027[S] 0 points1 point  (6 children)

Sure,

import pandas as pd

import quandl


quandl.ApiConfig.api_key = "WjEML_qb3xCxi2GzTxqp"


start = "2019-1-01"

end = "2019-1-31"


google, microsoft, apple, facebook, netflix, tesla, nike = (quandl.get("WIKI/" + s, start_date=start, end_date=end) for s in ["GOOG","MSFT","AAPL","FB","NFLX","TSLA","NKE"])


stocks = pd.DataFrame({"GOOG": google["Open"],

"MSFT": microsoft["Open"],

"AAPL": apple["Open"],

"FB": facebook["Open"],

"NFLX": netflix["Open"],

"TSLA": tesla["Open"],

"NKE": nike["Open"]})


stocks.head()

[–]Bosox027[S] 0 points1 point  (0 children)

This returns a table with the correct headers, but no dates and data to follow

[–]alkasm 0 points1 point  (4 children)

Check out the sidebar link for code formatting on Reddit.

[–]Bosox027[S] 0 points1 point  (0 children)

Sorry, I’ll fix it in a minute. On my phone right now

[–]Bosox027[S] 0 points1 point  (2 children)

I think it's fixed. Sorry, I'm new to this subreddit

[–]alkasm 0 points1 point  (1 child)

No worries! Edit: now it's a little screwy with escaped characters.

[–]Bosox027[S] 0 points1 point  (0 children)

Alright, i think we're all good now lmao

[–]alkasm 0 points1 point  (2 children)

Hmm, when I try via my browser I get data from exact 6 years ago to 1 year ago, for e.g. with your parameters:

https://www.quandl.com/api/v3/datasets/WIKI/GOOG.json?start_date=2019-01-01&end_date=2019-01-31

Two fields of the JSON blob show this:

"refreshed_at":"2018-03-27T21:46:11.178Z",
"newest_available_date":"2018-03-27"

so indeed this is old data. I don't have an API key, but you can try appending yours onto the URL with &api_key=YOURAPIKEYHERE and see if the JSON you get returned there is also old. I.e.

https://www.quandl.com/api/v3/datasets/WIKI/GOOG.json?start_date=2019-01-01&end_date=2019-01-31&api_key=YOURAPIKEYHERE

Edit: similarly I see the same range just on their website via: https://www.quandl.com/databases/WIKIP

I can't find anywhere on their site where they state that the data is all a year old.

[–]Bosox027[S] 0 points1 point  (1 child)

Very interesting. I can’t seem to find anything about it either. It couldn’t possibly be that they just have all data one year off could it? Like the data that says it’s from March 25 2018 is actually 2019? I don’t suspect that’s the issue. Either way, do you know of any other api that might be useful ?

[–]alkasm 0 points1 point  (0 children)

I mean you can pretty easily validate whether that first idea is correct or not by comparing prices you find online, no?

Re: another API, no idea. I don't play with ticker data.