Skip to content

Commit 5ebd4d2

Browse files
authored
some API doc refinements
1 parent 9745497 commit 5ebd4d2

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

docs/developer/API.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,25 @@ Our API gives you access to multiple energy data sources through a unified inter
3636
| Battery | Battery storage systems | State of charge (%), Power flow (kW) |
3737
| Energy Meter | Grid tie consumption/export | Consumption (kW), Delivery (kW), Phase data |
3838

39+
In general, data can be queried on a per gateway or specific DER basis. Use the [API Playground](https://api.srcful.dev/playground) for the most recent documentation and queries.
40+
3941
## Example Queries
4042

41-
### Real-time Solar Production
43+
### List gateway DERS
44+
```graphql
45+
{
46+
gateway {
47+
gateway(id: "your-gateway-id") {
48+
ders {
49+
type
50+
sn
51+
}
52+
}
53+
}
54+
}
55+
```
56+
57+
### Real-time Solar Production for a gateway
4258

4359
```graphql
4460
{
@@ -54,6 +70,22 @@ Our API gives you access to multiple energy data sources through a unified inter
5470
}
5571
```
5672

73+
### Real-time Solar Production for a solar DER
74+
75+
```graphql
76+
{
77+
derData {
78+
solar(sn: "your-der-serial-number") {
79+
latest {
80+
ts
81+
power # Current power in kW
82+
}
83+
today # Total generation today in kWh
84+
}
85+
}
86+
}
87+
```
88+
5789
### Battery Status with Historical Data
5890

5991
```graphql
@@ -66,8 +98,8 @@ Our API gives you access to multiple energy data sources through a unified inter
6698
soc # State of charge percentage
6799
}
68100
historical(
69-
start: "2023-06-01T00:00:00Z",
70-
stop: "2023-06-01T23:59:59Z",
101+
start: "2025-04-01T00:00:00Z",
102+
stop: "2025-05-01T23:59:59Z",
71103
resolution: "15m"
72104
) {
73105
ts
@@ -86,13 +118,14 @@ Our API gives you access to multiple energy data sources through a unified inter
86118
derData {
87119
energyMeter(gwId: "your-gateway-id") {
88120
latest {
121+
ts
89122
consumption # Grid power consumed (kW)
90123
delivery # Power exported to grid (kW)
91124
consumptionL1
92125
consumptionL2
93126
consumptionL3
94127
}
95-
daily(start: "2023-06-01", stop: "2023-06-07") {
128+
daily(start: "2025-04-01", stop: "2025-05-01") {
96129
ts
97130
consumption
98131
delivery

0 commit comments

Comments
 (0)