pwsdotru / worldtides-client
PHP Client for WorldTides.com API
1.0.0
2026-06-23 18:55 UTC
Requires
- php: >=8.3
- ext-json: *
- guzzlehttp/guzzle: 7.*
Requires (Dev)
- phpunit/phpunit: 12.*
- squizlabs/php_codesniffer: 3.7.*
This package is auto-updated.
Last update: 2026-07-14 19:22:52 UTC
README
API docs: https://www.worldtides.info/apidocs
Install
Via composer
composer require pwsdotru/worldtides-client
Usage
use Worldtides\API; $tides = new API('apikey'); $tides->setDate(date("Y-m-d")) ->setPoint("7.8333", "98.4167"); $heights = $tides->$tides->getHeights(7);
In $heights have array of points for next 7 days.
Array contains sets of array
Array
(
[0] => Array
(
[dt] => 1782752400
[date] => 2026-06-29T17:00+0000
[height] => 0.553
)
[1] => Array
(
[dt] => 1782754200
[date] => 2026-06-29T17:30+0000
[height] => 0.422
)
....
Where dt and date are time (in unix timestamp and string format). height is height of water in this time.
use Worldtides\API; $tides = new API('apikey'); $tides->setDate(date("Y-m-d")) ->setPoint("7.8333", "98.4167"); $img = $tides->$tides->getImage(7);
In $img have binary data of PNG image with graph for 7 days.