1

A friend asked me to develop a data product around Shanghai Stock Exchange data for him.

I don't think either of us realized that

  • Google Finance's API is defunct
  • Several others only have 1 stock representing a composite of that entire market
  • Quandl charges a minimal price of $360 for their version of the data

Is there anywhere that would at least let me have some of the data to play with, before making a major investment?

1 Answer 1

2

It turns out that you actually can get this data from Yahoo! Finance, but you just need to know the numeric representation of the Chinese ticker symbols of interest.

 prices
# A tibble: 141,040 x 8
   symbol    date        open  high   low close   volume adjusted
   <chr>     <date>     <dbl> <dbl> <dbl> <dbl>    <dbl>    <dbl>
 1 600000.ss 2018-09-03 10.3   10.3 10.2   10.2 14309539     10.2
 2 600000.ss 2018-09-04 10.2   10.4 10.2   10.4 16353060     10.4
 3 600000.ss 2018-09-05 10.3   10.4 10.1   10.1 22729232     10.1
 4 600000.ss 2018-09-06 10.1   10.2 10.1   10.1 10546916     10.1
 5 600000.ss 2018-09-07 10.2   10.2 10.1   10.2  8995716     10.2
 6 600000.ss 2018-09-10 10.2   10.2 10.1   10.2 11822813     10.2
 7 600000.ss 2018-09-11 10.2   10.3  9.98  10.0 19689042     10.0
 8 600000.ss 2018-09-12  9.99  10.1  9.95  10.0 16506103     10.0
 9 600000.ss 2018-09-13 10.2   10.3 10.1   10.3 29417198     10.3
10 600000.ss 2018-09-14 10.4   10.4 10.2   10.3 16450780     10.3

It also requires you to know the exchange in China as that info is not provided (so, for instance, you have to know that the Shanghai stock codes begin with a 6, so if you see one with a 0 or a 2 in the first character that's actually the Shenzhen exchange not Shanghai). In the example above I appended ".ss" to reflect that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.