Download the PHP package nieknijland/ista-php without Composer
On this page you can find all versions of the php package nieknijland/ista-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nieknijland/ista-php
More information about nieknijland/ista-php
Files in nieknijland/ista-php
Package ista-php
Short Description PHP client for the Ista energy consumption API
License MIT
Homepage https://github.com/nieknijland/ista-php
Informations about the package ista-php
Ista PHP
PHP client for the Ista energy consumption API at mijn.ista.nl. Framework-agnostic.
Requires PHP 8.4+.
Installation
Quick start
Constructor
| Parameter | Type | Default | Description |
|---|---|---|---|
$username |
string |
(required) | Your mijn.ista.nl username |
$password |
string |
(required) | Your mijn.ista.nl password (marked #[SensitiveParameter]) |
$httpClient |
?ClientInterface |
null |
Custom Guzzle HTTP client; null creates a default one |
$cache |
?CacheInterface |
null |
Any PSR-16 cache implementation; null disables caching |
$cacheTtl |
int |
3600 |
Cache time-to-live in seconds |
API methods
The client provides four methods. All throw IstaException on failure.
| Method | Description |
|---|---|
getUserValues() |
Fetch all customers, meters, and billing data |
getConsumptionAverages() |
Fetch building average consumption |
getMonthlyConsumption() |
Fetch month-by-month consumption history |
getConsumptionValues() |
Fetch consumption for a specific billing period |
See API Methods for full parameter documentation and examples.
Data objects
All API responses are returned as readonly DTOs with typed properties. Every DTO provides fromArray() and toArray() for serialization.
| Class | Description |
|---|---|
UserValuesResult |
Top-level response with customers |
Customer |
A customer with address and consumption data |
ConsumptionPeriod |
A billing period with services, meters, and temperatures |
ServiceComparison |
Current vs. previous year totals for a service type |
Meter |
A single meter reading with all technical fields |
BillingService |
Service type definition (e.g. Heating, Hot Water) |
BillingPeriod |
A billing year with start/end dates |
ConsumptionAverageResult |
Building average consumption |
ConsumptionValuesResult |
Consumption data for a specific billing period |
MonthlyConsumptionResult |
Monthly consumption history |
MonthlyConsumption |
A single month's consumption |
MonthlyServiceConsumption |
Per-service totals for a month |
MonthlyDeviceConsumption |
Per-device readings for a month |
See Data Objects for all properties and types.
Caching
Pass any PSR-16 CacheInterface to cache API responses and the JWT token:
Cache keys used:
| Key pattern | Data |
|---|---|
ista:jwt |
Authentication token |
ista:user-values |
getUserValues() response |
ista:consumption-averages:{cuid}:{start}:{end} |
getConsumptionAverages() response |
ista:monthly-consumption:{cuid} |
getMonthlyConsumption() response |
ista:consumption-values:{cuid}:{year}:{start}:{end} |
getConsumptionValues() response |
Cache failures are silently ignored -- the client will re-fetch from the API.
Error handling
All errors are wrapped in a single exception class:
Testing
The package ships testing utilities so you can mock the Ista client in your application tests without making real API calls.
See Testing for full documentation of FakeIsta, all factories, and recorded call inspection.
Development
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.