edgar icon indicating copy to clipboard operation
edgar copied to clipboard

Link offline

Open janlukasschroeder opened this issue 5 years ago • 16 comments

The link in your README.md http://www.sec.gov/edgar/NYU/cik.coleft.c is offline, and doesn't work anymore.

janlukasschroeder avatar Dec 28 '18 10:12 janlukasschroeder

@janlukasschroeder thanks - do you have any idea what is the replacement link?

rufuspollock avatar Jan 06 '19 13:01 rufuspollock

I developed a RESTful JSON API (https://mapping-api.herokuapp.com/) for this purpose.

You can provide the exchange name, and the API returns all companies listed at the exchange in JSON format. You can also send any CIK, company ticker, or company name, and the API returns the mapping.


Examples

List Companies by Exchange

Request: GET https://mapping-api.herokuapp.com/exchange/:exchange

Replace :exchange at the end of the URL with the exchange you are looking for, e.g. NASDAQ, or NYSE.

You can use regular expressions to retrieve companies listed on different exchanges. For example, if you want to list all companies listed on NASDAQ and NYSE, you can use https://mapping-api.herokuapp.com/exchange/NASDAQ|NYSE

Example: https://mapping-api.herokuapp.com/exchange/NASDAQ

Response:

[
    {
        "cik": "0001099290",
        "ticker": "AAC",
        "name": "Sinocoking Coal & Coke Chemical Industries Inc",
        "sic": "3312",
        "exchange": "NASDAQ",
        "irs": "593404233"
    },
    {
        "cik": "0000006201",
        "ticker": "AAL",
        "name": "American Airlines Group Inc",
        "sic": "4512",
        "exchange": "NASDAQ",
        "irs": "751825172"
    },
    {
        "cik": "0000008177",
        "ticker": "AAME",
        "name": "Atlantic American Corp",
        "sic": "6311",
        "exchange": "NASDAQ",
        "irs": "581027114"
    },
    // cut for brevity
]

Resolve by CIK

Request: GET https://mapping-api.herokuapp.com/cik/:cik

Replace :cik at the end of the URL with the CIK you want to resolve.

Example: https://mapping-api.herokuapp.com/cik/0001318605

Response:

[
    {
        "cik": "0001318605",
        "ticker": "TSLA",
        "name": "Tesla Motors Inc",
        "sic": "3711",
        "irs": "912197729"
    }
]

Removing trailing 0 from the CIK also works. Instead of using 0001318605, you can use 1318605. Same result.

Resolve by Ticker

Request: GET https://mapping-api.herokuapp.com/ticker/:ticker

Replace :ticker at the end of the URL with the ticker you want to resolve.

Example: https://mapping-api.herokuapp.com/ticker/tsla

Response:

[
  {
    "cik": "0001318605",
    "ticker": "TSLA",
    "exchange": "NASDAQ",
    "name": "Tesla Motors Inc",
    "sic": "3711",
    "irs": "912197729"
  },
  {
    "cik": "0000863456",
    "ticker": "WTSLA",
    "exchange": "",
    "name": "Wet Seal Inc",
    "sic": "5621",
    "irs": "330415940"
  }
]

Two companies are returned because WTSLA contains tsla. The API uses regular expressions under the hood allowing complex search queries. If you only want to retrieve exact matches, then use ^ as prefix, and $ as suffix. For example, ^tsla& (see below).

Example (exact match): GET https://mapping-api.herokuapp.com/ticker/^tsla$

Response:

[
  {
    "cik": "0001318605",
    "ticker": "TSLA",
    "exchange": "NASDAQ",
    "name": "Tesla Motors Inc",
    "sic": "3711",
    "irs": "912197729"
  }
]

Resolve by Name

Request: GET https://mapping-api.herokuapp.com/name/:name

Replace :name at the end of the URL with the company name you want to resolve.

Example: https://mapping-api.herokuapp.com/name/Tesla

Response:

[
  {
    "cik": "0001318605",
    "ticker": "TSLA",
    "exchange": "NASDAQ",
    "name": "Tesla Motors Inc",
    "sic": "3711",
    "irs": "912197729"
  }
]

Providing Tesla Motors as name returns the same result. You can use regular expressions here as well.

janlukasschroeder avatar Jan 07 '19 22:01 janlukasschroeder

Great.

rufuspollock avatar Jan 31 '19 19:01 rufuspollock

@janlukasschroeder Heads up - your API is down.

Also, where did you get the data that you're serving? I'd like to make my own API. Thanks!

nateraw avatar Mar 15 '19 07:03 nateraw

@nateraw thanks! API is online again.

janlukasschroeder avatar Mar 18 '19 04:03 janlukasschroeder

@janlukasschroeder Thank you!!

nateraw avatar Mar 18 '19 04:03 nateraw

@janlukasschroeder @nateraw

Did you ever discuss where you are pulling the data that is being served? I'm a finance guy who is trying to learn how to utilize code to make my own job easier, and this seems to be the best solution out there for mapping tickers / ckis / company names - but I would like to understand what is going on if possible.

Thank you!

EmersonFJ avatar Apr 07 '19 13:04 EmersonFJ

@EmersonFJ

Great to hear that my system is useful to others, too! I'm pulling the data from different sources across the Internet, and have an algorithm matching a request to its related objects (tickets, ckis, etc). It's a lot of data crunching, merging, transforming, and natural language processing.

What features/functions would you like to add? I'm happy to implement more features into my API.

janlukasschroeder avatar Apr 10 '19 10:04 janlukasschroeder

@janlukasschroeder

Thank you for the reply. Yes it is a nice tool - and it sounds like it took a bit of work to setup so thank you for doing that. It is also very quick. It is basically doing what I would use it for - the only additional thing I would do on my end is if the ticker match is null provide options for company search... but that is easy to implement on the client side.

Again, I'm totally out of my element here and just trying to learn for the sake of learning, so appreciate the reply.

Are you using the API for something else and just willing to share it as well here? I assume its not costless to host it / have others use it?

EmersonFJ avatar Apr 13 '19 20:04 EmersonFJ

@janlukasschroeder

I guess the other issue that I run into is for new ticker cik combinations or new companies...

For example, LYFT recently IPO'd and you can hit their filings by searching LYFT on EDGAR here, which means the SEC has mapped the ticker to cik: https://www.sec.gov/cgi-bin/browse-edgar?CIK=LYFT&owner=exclude&action=getcompany&Find=Search

but then using your api (which is great), https://mapping-api.herokuapp.com/ticker/lyft, fails to find the EDGAR information. As does using the cik search, https://mapping-api.herokuapp.com/cik/1759509.

That need to constantly refresh and update tickers and ciks is what is giving me trouble, but is also something that would be important.

Why the SEC doesn't just provide access to the ticker-cik mapping is beyond me...

EmersonFJ avatar May 11 '19 14:05 EmersonFJ

@janlukasschroeder thanks for your API, but it is somehow bugged.

For example, NASDAQ:BEAV is a company called "B/E AEROSPACE INC", but the API returns just "B" as the company name, calling the API on the NASDAQ exchange (link)

Another example, your API returns as name "CA Inc" something which is called "CA Technologies" and was acquired by Broadcom (link) in 2008, but the API still returns it as an independent entity

ghost avatar Jun 11 '19 01:06 ghost

@EmersonFJ the reason you are getting some unexpected results is due to the nature of Tickers. They change over time. So, this API only allows for a snapshot in time for any given ticker symbol. I agree, it's extremely frustrating that EDGAR does not have a lookup.

@raffam your first issue is likely due to a logic issue in the backend of the API. Your second issue sounds the same as what I described above.

In a perfect world, the API would be able to accept combinations of date and ticker/company name.

nateraw avatar Jun 11 '19 01:06 nateraw

@nateraw I would be satisfied with an updated data and correct company names ... I will look for other solutions to get pairs of CIK-names from a stock exchange since this API is closed

ghost avatar Jun 11 '19 11:06 ghost

@nateraw @raffam @EmersonFJ

I open sourced my source code for the mapping API: https://github.com/janlukasschroeder/cik-mapping

Pls feel free to submit pull requests to improve the API. Let me know if you have any questions.

janlukasschroeder avatar Jun 12 '19 10:06 janlukasschroeder

@janlukasschroeder thank you very much

The problem with the company "B/E Aerospace" which was erroneously called "B" by the script seems to lie in the source that your script uses (http://rankandfiled.com/static/export/cik_ticker.csv)

In any case this company has been acquired and thus delisted (link) and in fact its symbol does not exist anymore in NASDAQ.

Since it was acquired in 20017, that source is at least that old.

ghost avatar Jun 13 '19 07:06 ghost

Hi @janlukasschroeder, it looks like the API is down again :(

Also, do you know if http://rankandfiled.com/static/export/cik_ticker.csv is being updated?

sizcovich avatar Apr 07 '21 18:04 sizcovich