-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
225 lines (214 loc) · 6.29 KB
/
openapi.yaml
File metadata and controls
225 lines (214 loc) · 6.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
openapi: 3.0.3
info:
title: PharmaIntel API
description: |
Intelligent Pharmacist API providing pharmaceutical intelligence including drug interactions, FDA recalls, and WHO health articles.
Built with security best practices and ready for production deployment.
version: 1.0.0
contact:
name: Dr. Mostafa Abd-el-Kader
license:
name: ISC
url: https://opensource.org/licenses/ISC
servers:
- url: http://localhost:3000
description: Local development server
- url: https://your-cloudrun-url.run.app
description: Production server (Google Cloud Run)
tags:
- name: Health
description: Service health and status endpoints
- name: Drug Interactions
description: Check drug-to-drug interactions
- name: FDA Recalls
description: Query FDA drug recall information
- name: WHO
description: Fetch WHO Global Health Observatory articles
paths:
/:
get:
tags:
- Health
summary: Welcome message
description: Returns a welcome message with API information
responses:
'200':
description: Successful response
content:
text/html:
schema:
type: string
example: PharmaIntel Bot API — Powered by COPILOT TO ACHIEVE — DR / MOSTAFA ABD-EL-KADER — IDEA @2025
/health:
get:
tags:
- Health
summary: Health check endpoint
description: Returns service status and version information
responses:
'200':
description: Service is healthy
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: ok
service:
type: string
example: PharmaIntel
version:
type: string
example: v1
/api/interactions:
post:
tags:
- Drug Interactions
summary: Check drug interactions
description: |
Check for potential interactions between multiple drugs using the DrugBank API.
Requires DRUGBANK_API_KEY environment variable to be set.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- drugs
properties:
drugs:
type: array
description: Array of drug names to check for interactions
minItems: 1
items:
type: string
example: ['aspirin', 'ibuprofen']
responses:
'200':
description: Successful interaction check
content:
application/json:
schema:
type: object
description: Interaction data from DrugBank API
'400':
description: Invalid request (missing or empty drugs array)
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: 'Invalid request: "drugs" must be a non-empty array.'
'429':
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'502':
description: DrugBank API request failed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: Interaction check failed
/api/recalls:
get:
tags:
- FDA Recalls
summary: Query FDA drug recalls
description: |
Retrieve FDA drug recall information for a specific ingredient.
Uses the OpenFDA API (no API key required).
parameters:
- name: ingredient
in: query
required: true
description: Drug ingredient name to search for recalls
schema:
type: string
example: ibuprofen
responses:
'200':
description: Successful recall query
content:
application/json:
schema:
type: array
description: Array of recall records from OpenFDA
items:
type: object
'400':
description: Missing ingredient parameter
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: 'Missing "ingredient" query param.'
'429':
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'502':
description: OpenFDA API request failed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: Recall fetch failed
/api/who:
get:
tags:
- WHO
summary: Fetch WHO articles
description: |
Retrieve articles from the WHO Global Health Observatory.
No parameters required.
responses:
'200':
description: Successful WHO articles fetch
content:
application/json:
schema:
type: object
description: WHO articles data
'429':
description: Rate limit exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'502':
description: WHO API request failed
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: WHO articles fetch failed
components:
schemas:
Error:
type: object
properties:
error:
type: string
description: Error message
required:
- error
securitySchemes:
RateLimit:
type: apiKey
in: header
name: X-RateLimit-Limit
description: Rate limiting (60 requests per minute per IP)
security:
- RateLimit: []