Preview:
def bcra_query(variable='dolar_blue', url='https://api.estadisticasbcra.com/usd'):

    r = requests.get(url=url,
                                            headers={'Authorization':'BEARER '+bearer
                                
                            })
    r_dict = json.loads(r.text)

    df = pd.DataFrame(r_dict)


    df.rename(columns={'v': variable,
                                            'd':'fecha'},
                        inplace=True)

    #dolar_blue = df

    today = date.today()
    str(today)

    df.to_csv('dataset_'+variable, index=False)
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter