11# One Call 4.0
22
3- One Call 4.0 requires a separate OpenWeather subscription and includes free
4- daily API calls. Consult OpenWeather's official documentation for the current
5- allowance, pricing, usage limits, and account configuration before using these
6- endpoints in production.
3+ OpenWeather manages access and usage terms for One Call 4.0. Consult the
4+ [ official One Call documentation] ( https://openweathermap.org/api/one-call-4 )
5+ for current requirements before using these endpoints.
76
87## Current
98
109See OpenWeather's
1110[ official One Call API 4.0 documentation] ( https://openweathermap.org/api/one-call-4#current )
12- for API details and current subscription terms .
11+ for API details.
1312
1413Use ` current() ` with a latitude and longitude.
1514
@@ -24,9 +23,9 @@ $current = $api->oneCall()->current(
2423);
2524```
2625
27- Every response property may be absent or explicitly ` null ` . Coordinates and
28- timezone metadata describe the requested location, while ` dateTime() ` and the
29- astronomical timestamps remain UTC values .
26+ Every response property may be absent or ` null ` . Coordinates and timezone
27+ details describe the requested location. ` dateTime() ` , sunrise, and sunset use
28+ UTC.
3029
3130``` php
3231echo $current->coordinates()?->latitude();
@@ -53,7 +52,7 @@ $current = $api
5352 ->current(38.7223, -9.1393);
5453```
5554
56- Measurement getters return nullable values. Companion methods provide the unit
55+ Measurement getters return nullable values. Related methods provide the unit
5756and a formatted value. With the default metric configuration, for example:
5857
5958``` php
@@ -80,7 +79,7 @@ $timeline = $api->oneCall()->minuteTimeline(
8079);
8180```
8281
83- The response exposes location metadata and forecast periods. Each period
82+ The response contains location details and forecast periods. Each period
8483provides its UTC date and time, precipitation, and any referenced alert IDs.
8584
8685``` php
@@ -124,7 +123,7 @@ Use `startAt` to select a future starting point and `count` to limit the number
124123of periods returned. Both are optional, and ` count ` must be positive when
125124provided.
126125
127- The response exposes location metadata , up to 50 periods, and pagination when
126+ The response contains location details , up to 50 periods, and pagination when
128127OpenWeather provides it.
129128
130129``` php
@@ -138,8 +137,8 @@ foreach ($timeline->periods() as $period) {
138137}
139138```
140139
141- The 15-minute, one-hour, and one-day timelines normalize OpenWeather's
142- fractional precipitation probability to a percentage :
140+ Precipitation probability follows the same getter pattern as other
141+ measurements :
143142
144143``` php
145144$period->precipitationProbability(); // 91.0
@@ -177,8 +176,8 @@ $timeline = $api->oneCall()->hourTimeline(
177176);
178177```
179178
180- The response contains up to 20 periods. Historical and forecast periods expose
181- their UTC date and time through ` dateTime() ` .
179+ The response contains up to 20 periods. ` dateTime() ` returns each period's UTC
180+ date and time.
182181
183182``` php
184183foreach ($timeline->periods() as $period) {
@@ -220,9 +219,9 @@ $timeline = $api->oneCall()->dayTimeline(
220219);
221220```
222221
223- The response contains up to 10 periods. Daily periods provide UTC dates,
224- astronomy , daily temperatures, weather measurements, conditions, precipitation
225- probability, rain, snow, and alert references.
222+ The response contains up to 10 periods. Daily periods provide UTC dates, sun
223+ and moon times , daily temperatures, weather measurements, conditions,
224+ precipitation probability, rain, snow, and alert references.
226225
227226``` php
228227foreach ($timeline->periods() as $period) {
@@ -237,12 +236,12 @@ foreach ($timeline->periods() as $period) {
237236}
238237```
239238
240- OpenWeather does not currently define units for the daily scalar rain and snow
241- values, so these getters return raw nullable floats.
239+ OpenWeather does not define units for the daily ` rain ` and ` snow ` values, so
240+ these getters return nullable floats without conversion .
242241
243242## Timeline Pagination
244243
245- The 15-minute, one-hour, and one-day timelines provide explicit pagination.
244+ The 15-minute, one-hour, and one-day timelines support pagination.
246245
247246``` php
248247$timeline = $api->oneCall()->hourTimeline(
@@ -266,11 +265,8 @@ echo $pagination->nextPageUrl();
266265
267266The availability checks and URL getters do not make another API request.
268267` previousPage() ` and ` nextPage() ` request the corresponding page when its URL
269- is available and otherwise return ` null ` . Pagination does not iterate
270- automatically. Every pagination request counts as a separate One Call API call
271- under your OpenWeather subscription; consult the
272- [ official documentation] ( https://openweathermap.org/api/one-call-4#pagination )
273- for current usage and billing terms.
268+ is available and otherwise return ` null ` . The library does not fetch every page
269+ automatically. Each page navigation sends a separate API request.
274270
275271## Alert
276272
@@ -308,7 +304,7 @@ foreach ($current->alertIds() as $id) {
308304}
309305```
310306
311- Alerts provide sender and event information, validity dates , localized
307+ Alerts provide sender and event information, start and end times , localized
312308descriptions, and tags.
313309
314310` description() ` returns the first exact language-code match or ` null ` .
0 commit comments