-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabstract-api-timezones.yaml
More file actions
273 lines (273 loc) · 8.53 KB
/
abstract-api-timezones.yaml
File metadata and controls
273 lines (273 loc) · 8.53 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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
openapi: 3.0.3
info:
title: Abstract API - Timezone API
description: Find, convert, and manage time and timezone data across the world. Supports lookup by location or coordinates and returns local time, timezone abbreviation, UTC offset, and DST information.
version: 1.0.0
contact:
url: https://www.abstractapi.com/
x-generated-from: documentation
servers:
- url: https://timezone.abstractapi.com/v1
description: Timezone API v1
security:
- apiKey: []
tags:
- name: Timezones
description: Timezone lookup and conversion operations
paths:
/current_time:
get:
operationId: getCurrentTime
summary: Abstract API Get Current Time
description: Get the current time, date, and timezone for a location specified by name, coordinates, or IP address.
tags:
- Timezones
parameters:
- name: api_key
in: query
required: true
description: Your unique API key for the Timezone API.
schema:
type: string
example: abc123def456
- name: location
in: query
required: false
description: Location name (e.g., city, address). Use location, latitude+longitude, or ip_address.
schema:
type: string
example: New York City
- name: latitude
in: query
required: false
description: Latitude coordinate. Used with longitude.
schema:
type: number
format: double
example: 40.7128
- name: longitude
in: query
required: false
description: Longitude coordinate. Used with latitude.
schema:
type: number
format: double
example: -74.006
- name: ip_address
in: query
required: false
description: IP address to determine timezone from.
schema:
type: string
example: 8.8.8.8
responses:
'200':
description: Current time and timezone information
content:
application/json:
schema:
$ref: '#/components/schemas/CurrentTimeResponse'
examples:
getCurrentTime200Example:
summary: Default getCurrentTime 200 response
x-microcks-default: true
value:
datetime: '2026-04-19 10:30:00'
timezone_name: America/New_York
timezone_location: New York, United States
timezone_abbreviation: EDT
gmt_offset: -4
is_dst: true
requested_location: New York City
latitude: 40.7128
longitude: -74.006
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
/convert_time:
get:
operationId: convertTime
summary: Abstract API Convert Time Between Timezones
description: Convert time from one location to another, or convert to and from UTC.
tags:
- Timezones
parameters:
- name: api_key
in: query
required: true
description: Your unique API key.
schema:
type: string
example: abc123def456
- name: base_location
in: query
required: true
description: Source location name or coordinates.
schema:
type: string
example: London
- name: base_datetime
in: query
required: false
description: Date and time to convert (YYYY-MM-DD HH:MM:SS). Defaults to current time.
schema:
type: string
example: '2026-04-19 10:30:00'
- name: target_location
in: query
required: true
description: Target location name or coordinates.
schema:
type: string
example: Tokyo
responses:
'200':
description: Time conversion result
content:
application/json:
schema:
$ref: '#/components/schemas/ConvertTimeResponse'
examples:
convertTime200Example:
summary: Default convertTime 200 response
x-microcks-default: true
value:
base_location: London
base_datetime: '2026-04-19 10:30:00'
base_timezone_name: Europe/London
base_timezone_abbreviation: BST
base_utc_offset: 1
target_location: Tokyo
target_datetime: '2026-04-19 18:30:00'
target_timezone_name: Asia/Tokyo
target_timezone_abbreviation: JST
target_utc_offset: 9
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
components:
securitySchemes:
apiKey:
type: apiKey
in: query
name: api_key
schemas:
CurrentTimeResponse:
type: object
description: Current time and timezone data for a location
properties:
datetime:
type: string
description: Current date and time in the target timezone
example: '2026-04-19 10:30:00'
timezone_name:
type: string
description: IANA timezone name
example: America/New_York
timezone_location:
type: string
description: Human-readable location description
example: New York, United States
timezone_abbreviation:
type: string
description: Timezone abbreviation
example: EDT
gmt_offset:
type: integer
description: GMT/UTC offset in hours
example: -4
is_dst:
type: boolean
description: Whether daylight saving time is active
example: true
requested_location:
type: string
description: The input location string
example: New York City
latitude:
type: number
format: double
description: Latitude of the location
example: 40.7128
longitude:
type: number
format: double
description: Longitude of the location
example: -74.006
ConvertTimeResponse:
type: object
description: Time zone conversion result
properties:
base_location:
type: string
description: Source location
example: London
base_datetime:
type: string
description: Input date and time
example: '2026-04-19 10:30:00'
base_timezone_name:
type: string
description: Source IANA timezone name
example: Europe/London
base_timezone_abbreviation:
type: string
description: Source timezone abbreviation
example: BST
base_utc_offset:
type: integer
description: Source UTC offset in hours
example: 1
target_location:
type: string
description: Target location
example: Tokyo
target_datetime:
type: string
description: Converted date and time
example: '2026-04-19 18:30:00'
target_timezone_name:
type: string
description: Target IANA timezone name
example: Asia/Tokyo
target_timezone_abbreviation:
type: string
description: Target timezone abbreviation
example: JST
target_utc_offset:
type: integer
description: Target UTC offset in hours
example: 9
ErrorResponse:
type: object
properties:
message:
type: string
example: The provided API key is invalid
error:
type: string
example: invalid_api_key