question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CIK Lookup API broken

See original GitHub issue

Describe the bug CIK mappings / lookup API is currently broken.

To Reproduce

>>> from secedgar.filings.cik_lookup import CIKLookup
>>> lookups = CIKLookup(['aapl', 'msft', 'Facebook'])
>>> lookups.lookup_dict

Traceback (most recent call last):
  File "/home/ermin/.local/lib/python3.8/site-packages/secedgar/client/network_client.py", line 97, in get_response
    self._validate_response(response)
  File "/home/ermin/.local/lib/python3.8/site-packages/secedgar/client/network_client.py", line 139, in _validate_response
    raise EDGARQueryError("The query could not be completed. "
secedgar.utils.exceptions.EDGARQueryError: The query could not be completed. There was a client-side error with your request.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ermin/.local/lib/python3.8/site-packages/secedgar/filings/cik_validator.py", line 89, in _get_lookup_soup
    return self._client.get_soup(self.path, self.params)
  File "/home/ermin/.local/lib/python3.8/site-packages/secedgar/client/network_client.py", line 117, in get_soup
    return BeautifulSoup(self.get_response(path, params, **kwargs).text, features='lxml')
  File "/home/ermin/.local/lib/python3.8/site-packages/secedgar/client/network_client.py", line 102, in get_response
    raise EDGARQueryError()
secedgar.utils.exceptions.EDGARQueryError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ermin/.local/lib/python3.8/site-packages/secedgar/client/network_client.py", line 97, in get_response
    self._validate_response(response)
  File "/home/ermin/.local/lib/python3.8/site-packages/secedgar/client/network_client.py", line 139, in _validate_response
    raise EDGARQueryError("The query could not be completed. "
secedgar.utils.exceptions.EDGARQueryError: The query could not be completed. There was a client-side error with your request.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ermin/.local/lib/python3.8/site-packages/secedgar/filings/cik_lookup.py", line 39, in lookup_dict
    self._lookup_dict = self._validator.get_ciks()
  File "/home/ermin/.local/lib/python3.8/site-packages/secedgar/filings/cik_validator.py", line 64, in get_ciks
    result = self._get_cik(lookup)
  File "/home/ermin/.local/lib/python3.8/site-packages/secedgar/filings/cik_validator.py", line 108, in _get_cik
    soup = self._get_lookup_soup(lookup)
  File "/home/ermin/.local/lib/python3.8/site-packages/secedgar/filings/cik_validator.py", line 93, in _get_lookup_soup
    return self._client.get_soup(self.path, self.params)
  File "/home/ermin/.local/lib/python3.8/site-packages/secedgar/client/network_client.py", line 117, in get_soup
    return BeautifulSoup(self.get_response(path, params, **kwargs).text, features='lxml')
  File "/home/ermin/.local/lib/python3.8/site-packages/secedgar/client/network_client.py", line 102, in get_response
    raise EDGARQueryError()
secedgar.utils.exceptions.EDGARQueryError

Expected behavior Return a dict as per documentation of the API

Desktop (please complete the following information): Ubuntu Linux 20.04, master branch, self-installed

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ermin-sakiccommented, Dec 2, 2020

@jackmoody11 , from initial tests, I can confirm this has solved the issue with the rate limiter. Thanks for the fast fix!

0reactions
jackmoody11commented, Nov 28, 2020

@ermin-sakic this should be taken care of now. Can you pip install git+https://github.com/sec-edgar/sec-edgar.git and run your code again to verify? I will release to PyPi after.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EDGAR Company Filings | CIK Lookup - SEC.gov
The Central Index Key (CIK) is used on the SEC's computer systems to identify corporations and individual people who have filed disclosure ...
Read more >
Python Edgar package - get CIK number - Stack Overflow
I am reading S-1 filings from Edgar sec. I get my initial data from Bloomberg. Through the company name I can look for...
Read more >
CIK Lookup — secedgar 0.4.1 documentation - GitHub Pages
The CIKLookup class allows users to get company filings using company tickers and/or company names. ; Below is an example of how you...
Read more >
Map CUSIP to CIK - Quantitative Finance Stack Exchange
If I had a way to reliably map CUSIPs to CIKs that would solve my problem - but "official" way of https://www.sec.gov/edgar/NYU/cik.coleft.c ...
Read more >
How to use the EDGAR Database in Python | Building Requests
We've seen that the SEC has a wealth of financial data that is freely available. In a previous series, we explored some of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found