sec-edgar icon indicating copy to clipboard operation
sec-edgar copied to clipboard

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Open yawenwu821 opened this issue 1 year ago • 5 comments

Describe the bug When I used get_urls() from CompanyFilings, I got this error: JSONDecodeError: Expecting value: line 1 column 1 (char 0)

To Reproduce

Code: from secedgar import CompanyFilings, FilingType

my_filings = CompanyFilings(cik_lookup='aapl', filing_type=FilingType.FILING_10Q, count=15, user_agent='Name (email)')

res = my_filings.get_urls()

Expected behavior Expect there is no error

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information): If specific to your OS, please specify which OS you are using [e.g. Windows, macOS, Ubuntu Linux, etc.] ubuntu Additional context Add any other context about the problem here. NO

yawenwu821 avatar Jul 30 '24 06:07 yawenwu821

same here, on Windows

Almie avatar Aug 25 '24 06:08 Almie

any updates? same issue

pmoe7 avatar Sep 08 '24 23:09 pmoe7

Hi @pmoe7, @Almie, @yawenwu821 have you all tried using a real name and email instead of just putting user_agent='Name (email)'? Also, make sure you have installed the latest development version with python -m pip install git+https://github.com/sec-edgar/sec-edgar.git. Let me know if that solves your issue. Still need to work on releasing recent changes to Pypi.

jackmoody11 avatar Sep 08 '24 23:09 jackmoody11

Hi @jackmoody11 , the issue still exists after I update the package and set a real email. Is it possible that the URL request returned an empty response or an error HTML page, rather than the expected JSON format data? Or the server returned invalid data?

Alexzeqi avatar Sep 28 '24 16:09 Alexzeqi

Hello,

I also had this issue, and after looking at the code, it seems that there is an issue with the GET request to "https://www.sec.gov/files/company_tickers.json" (line 32 of cik_lookup.py). It seems that there is no user-agent specified for this call, and as such the server responds 403.

Edit

I see that the code has been fixed in the repository (user-agent header has been added). I guess it is just a matter of updating the release on PyPI.

Sebiancoder avatar Oct 20 '24 01:10 Sebiancoder

Hey, Any updates on this? I'm getting this error on version 0.5.0.

renanmoretto avatar Oct 26 '24 14:10 renanmoretto

Hey, Any updates on this? I'm getting this error on version 0.5.0.

Working on releasing the most recent version to PyPi @renanmoretto. I believe this issue is fixed on the latest version of the master branch. Can you try python -m pip install git+https://github.com/sec-edgar/sec-edgar.git and see if that fixes the issue?

jackmoody11 avatar Oct 26 '24 18:10 jackmoody11