Chúng tôi không thể tìm thấy kết nối internet
Đang cố gắng kết nối lại
Có lỗi xảy ra!
Hãy kiên nhẫn trong khi chúng tôi khắc phục sự cố
Cách sử dụng OpenFDA API với Python & R (Hướng dẫn Khoa học Dữ liệu)
In this tutorial, I will help you get started with learning how to extract data from the OpenFDA API using both Python and R. We will work with medication adverse event data, which is among the easiest of the FDA datasets to use as a firstimer. Whether you're a beginner or an experienced coder, this guide will help you understand how to make API requests, handle the response, and process the data for analysis. OpenFDA is your go-to place for medication, food, medical device data, and it has a lot of it!
USE OF API KEY
For most use cases with the OpenFDA API, you do not need an API key. The API is accessible without authentication for basic queries, making it easy for users to get started quickly. However, if you plan to make a large number of requests or need to use advanced features, you might need an API key to manage your usage and avoid rate limiting. An API key allows the FDA to monitor and control the usage to ensure fair access for all users.
In general, here are the OpenFDA API lmits:
- With no API key: 240 requests per minute, per IP address. 1,000 requests per day, per IP address.
- With an API key: 240 requests per minute, per key. 120,000 requests per day, per key.
To learn more about using the API key, see: https://open.fda.gov/apis/authentication/#:~:text=Here%20are%20openFDA's%20standard%20limits,requests%20per%20minute%2C%20per%20key.
CODE
Python Adverse Event Example: https://controlc.com/2b084474
Python Adverse Event Example with Placeholder for API Key: https://controlc.com/e9095111
Python Junk Food/Food Recall Example: https://controlc.com/d661bfc5
R Averse Event Example: https://controlc.com/787bffea
R Adverse Event Example with Placeholder for API Key: https://controlc.com/04bbf62b
R Junk Food/Food Recall Example: https://controlc.com/e1459b12
LINKS
Adverse Event Data Overview: https://open.fda.gov/apis/drug/event/
API Query Examples in Browser - Adverse Event Data: https://open.fda.gov/apis/drug/event/example-api-queries/
VIDEO TIMELINE
0:00 - Intro
0:04 - Overview of OpenFDA API
0:58 - Coding Example 1: Getting started with Python
1:45 - Coding Example 1: Diving into the code
5:21 - Coding Example 1: Running the code
5:26 - Coding Example 1: Checking out the results
5:45 - Coding Example 2: Getting started with R
6:26 - Coding Example 2: Diving into the code
8:26 - Coding Example 2: Running the code
8:31 - Coding Example 2: Checking out the results
8:50 - Summarizing
9:17 - Outro
Dịch Vào Lúc: 2025-03-30T07:39:56Z