/
eb
/
python_learn
Обзор
Документация
Войти
/
eb
/
python_learn
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
http_api/api_intro.py
17 строк
577 B
EvgeniyBudaev
BeautifulSoup
25 фев 2021, 06:00
25 фев 2021, 06:00
0930aa3
Код
Авторство
О чём код?
import requests # url = 'https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2014-01-01&endtime=2014-01-02' # response = requests.get(url, headers={'Accept':'application/json'}) url = 'https://earthquake.usgs.gov/fdsnws/event/1/query?' response = requests.get(url, headers={'Accept':'application/json'}, params={ 'format': 'geojson', 'starttime': '2014-01-01', 'endtime': '2014-01-02' }) # print(response.text) # print(response.json()) # print(type(response.json())) # dict data = response.json() print(data['features'][0]['properties']['place'])