The tedious part about all of this is that there is no company name standard apparent to me, as CIK company name, exchange company name, and legal company name can all be different. I have to get my hands dirty with the method I use.

I only trade options, so I download the CBOE's master list in csv and input into my database. I think the stock exchanges post something similar.

For this, I made a simple php script that iterates through each ticker I receive from the CBOE, searching first the entire company name then each word individually, both except for words like "the", "company", "corporation", "inc", etc and dump the results into a database.

You'll see that with the "other search" there are two results: a company page if there's only result or a company list if there're multiple. Both are easy to parse.

When there's 1 result for the search with the "sanitized" entire company name, I just went with that initially and started on the ones with multiples (rare with full name search) or no results (sometimes with full name search). Over time, I have confirmed all manually.

This can probably be tidied up a bit but I gave it a try and it worked.

Cerin's comment referenced a discussion thread that lead me to discover in fact you can query EDGAR directly with ticker names. it's not clear to me why this wasn't apparent before, perhaps it's a new feature. If you go to [EDGAR's Company Search][2] page you can type in a ticker and get the associated CIK and companies filings; here's the result page for KO again - even better, the data is served up as XML, making it very easy to parse.