JSONDecodeError: Expecting value: line 1 column 1 (char 0)
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
same here, on Windows
any updates? same issue
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.
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?
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.
Hey, Any updates on this? I'm getting this error on version 0.5.0.
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?