a
This commit is contained in:
9
WS24_25/PyCharm/pythonProject/P3/api.py
Normal file
9
WS24_25/PyCharm/pythonProject/P3/api.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import requests
|
||||
import json
|
||||
import pandas as pd
|
||||
api_url = "https://overfast-api.tekrop.fr/heroes"
|
||||
response = requests.get(api_url)
|
||||
json_data = response.json()
|
||||
with open('heroes.json', 'w') as outfile: json.dump(json_data, outfile)
|
||||
df = pd.read_json(json.dumps(json_data))
|
||||
csv_data = df.to_csv('csv_data.csv')
|
||||
Reference in New Issue
Block a user