mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-30 13:13:59 +00:00
* breakpoint 1 * breakpoint pt 1 * Finish fred request * Add **kwargs to all fmp funcs * Moved all fmp funcs to custom request * benzinga requests * add polygon requests * remove comment * move make_request to helpers --------- Co-authored-by: montezdesousa <montezdesousa@gmail.com>
15 lines
391 B
Python
15 lines
391 B
Python
# IMPORT THIRD PARTY
|
|
from openbb_provider import helpers
|
|
|
|
|
|
def get_data(url: str, **kwargs) -> dict:
|
|
r = helpers.make_request(url, **kwargs)
|
|
if r.status_code != 200:
|
|
data = r.json()
|
|
message = data.get("message")
|
|
error = data.get("error")
|
|
value = message or error
|
|
raise RuntimeError(f"Error in Polygon request -> {value}")
|
|
|
|
return r.json()
|