# Data sources for financials of global equities

I looked through the master list of data sources but could not find any data sources for financial data of global equities. An example would be the balance sheet of, say, STO:HM-B. The company can be found on both Yahoo Finance and Google Finance but they do not give any financial data.

Morningstar.com is the only online site I've found so far that even has the data, but I suspect that isn't free data to use in applications. Also, even if I were to want to scrape that data it would be near impossible since it appears to be JavaScript generated post-page load.

What I'm hoping to find is something in XML format or in a format I can myself translate to XML. Even HTML is fine, just as long as it's one site for all financials for most global equities.

-
Is there an issue with Bloomberg or Thomson-Reuters? That's what any professional would use. –  chrisaycock Jun 2 '13 at 18:06
Sorry, I should have specified more clearly that I preferably wanted something that's free to use. –  Doggie52 Jun 2 '13 at 18:17
For US companies you can scrape it yourself because it's public information -- not an easy task though! sec.gov/edgar/searchedgar/cik.htm –  Brian B Jun 3 '13 at 12:52
@BrianB H&M is a big Swedish retailer, so that approach wouldn't apply (it's also why there isn't any data on Google/Yahoo). I'm not aware of any free site for global balance sheet information. I get mine from Bloomberg or Factset. –  John Jun 3 '13 at 15:40

Morningstar is the best one I've found so far. It has all the data required and, as I've recently found, can export it quite easily to CSV. The key is to send the right parameters to /ajax/ReportProcess4CSV.html. In what scenarios scraping this is allowed, I do not know. I will endeavor to find out once I start building this application.

For anyone looking to do the same thing, the following parameters are the ones I use:

\$defaults = array(
't'             => '',      // The ticker
'reportType'    => '',      // 'is', 'bs' or 'cf' depending on what you want
'period'        => 12,
'dataType'      => 'A',
'columnYear'    => 5,
);


The last three parameters are not there for you to change but simply have to be part of the URL.

-

Marketwatch has financials for a lot of companies, including H&M: Annual Financials for H&M Hennes & Mauritz AB Series B

-

The prices you are looking for can be found at https://www.google.com/finance/getprices?q=HM-B&x=STO&i=60&p=5d&f=d,c,o,h,l&df=cpct&auto=1&ts=1266701290218

URL breakdown, I am lazy so I copied

q= stock symbol on Google finance x= exchange symbol i= interval (here 60 means 60 sec (1 minute interval))

p= no of period(here 5d denotes 5days of data)

f= parameters (day, close, open, high and low) df= difference (cpct is may be in % change )

auto =1, ts = time start…

Source

Javascript page scraping...

This is a tip for dealing with the javascript driven pages when scraping. If you write a scraper in .Net, use a visible or invisible WebBrowser control, suppress errors and allow the page to load. After load, you can force the click state (control.InvokeMember("onclick")) on whatever control you need and you are good.

Below is a snipit in VB:

    WebB.ScriptErrorsSuppressed = True
WebB.Navigate("http://......")
WaitForPageLoad() 'this is custom, search stackoverflow for this
Dim doc As HtmlDocument = WebB.Document

For Each c As HtmlElement In doc.All
If c.Name = "someelementname" Then
Dim ctrlAll As HtmlElement = doc.All(c.Id)
c.InvokeMember("onclick")
End If
Next