Power Outage Data in Zapier

To get power outage data into Zapier, build a Zap that runs every hour with Schedule by Zapier, fetches county outage counts from the PowerOutage.us v2 REST API with a Webhooks by Zapier GET step and an Authorization header, stops with Filter by Zapier when no county is over your threshold, and otherwise sends the counties to any app Zapier connects to, such as Slack, Gmail or Google Sheets. Webhooks by Zapier needs a Professional plan or higher, and Schedule by Zapier runs at most once an hour, so this Zap suits hourly status updates; the FAQ covers what each plan allows if you need a shorter interval.

What you'll have

  • An hourly Slack message, email or spreadsheet rows listing every county with at least your threshold of customers out, in the states you choose.
  • No message and no action task in hours when no county is over the threshold.
  • Any of the thousands of apps Zapier connects to as the destination, with no code.
  • One API request an hour, about 720 a month.

What you need

An API key (request one with the form below) and these endpoints. Full details are in the API reference.

EndpointMethodUsed forPackage
/outages/countiesGETCustomers out per county in the states you choose, filtered with minCustomersOut so only counties over your threshold come back.Core

Step 1: Check your plan

Webhooks by Zapier and multi-step Zaps need a Professional, Team or Enterprise plan; the Free plan has neither. Each hourly run uses one task for the GET step, about 720 tasks a month before any messages, and one more task for each action that runs. Triggers and Filter by Zapier steps don't use tasks, so hours with nothing to report cost one task. /outages/counties is in the Core package.

Step 2: Trigger every hour with Schedule by Zapier

Create a Zap, choose Schedule by Zapier as the trigger app and Every Hour as the trigger event, and let it run on weekends, because storms don't keep office hours. Every hour is the shortest interval Schedule by Zapier offers.

Step 3: Fetch county outages with Webhooks by Zapier

Add a Webhooks by Zapier action with the GET event. Put the URL without parameters in URL, the parameters under Query String Params, and the header under Headers, as below. Change stateId to your states, using ids from /outages/states, and minCustomersOut to your threshold. Zapier has no secret store for this step, so the key sits in the Headers field: anyone who can open or copy the Zap, or read its run history, can read the key. Use a separate API key for the Zap, restricted to the states it watches, so a leaked key exposes little and can be revoked without touching your other integrations.

text
Webhooks by Zapier    Action event: GET

URL                   https://poweroutage.us/api/v2/outages/counties
Query String Params   stateId           44,45
                      minCustomersOut   5000
Headers               Authorization     Bearer <YOUR_API_KEY>

Step 4: Test the step and see the fields

Test the GET step. The response has a data list with one item per county, and Zapier shows its fields as line items, such as Data Name and Data Customers Out. If no county is over your threshold right now, the test returns an empty list and there are no county fields to map: set minCustomersOut to 1 for the test, map the fields in the next steps, then set it back. If the step fails with a 401, check the header value starts with Bearer and a space.

Step 5: Add a Filter, then the action

Add Filter by Zapier and continue only if Data Id exists, so the Zap stops in hours with no county over the threshold. Then add the action you want. Mapped into a text field, line items arrive as comma-separated lists in the same order, so a Slack message reads as a list of names and a matching list of counts. Google Sheets' Create Multiple Spreadsheet Rows writes one row per county instead, which makes an hourly log. Key any lookups on Data Id rather than Data Name, because county names repeat across states.

text
Response field        Zapier field (line items)   Use it for
data[].id             Data Id                     the Filter, and as a row id in Sheets
data[].name           Data Name                   the county name
data[].stateId        Data State Id               the state; ids from /outages/states
data[].customersOut   Data Customers Out          customers without power
data[].lastUpdatedAt  Data Last Updated At        when the utility data was last read (UTC)
meta.generatedAt      Meta Generated At           when the API answered (UTC)

Filter by Zapier      Only continue if...  Data Id   (Text) Exists

Slack: Send Channel Message
  Message Text        Counties with 5,000+ customers out: Data Name
                      Customers out: Data Customers Out
Google Sheets: Create Multiple Spreadsheet Rows
  one row per county: Data Id, Data Name, Data State Id, Data Customers Out,
  Data Last Updated At

Step 6: Turn it on and watch the first runs

Publish the Zap and check Zap history after the next hour: one run per hour, stopped at the Filter when nothing is over the threshold. While a storm lasts, the Zap sends the current list every hour, which works as a status update. If the GET step ever gets a 429 because another tool shares the key, Zapier doesn't wait out the Retry-After seconds; that run fails and the next hour's run fetches fresh data, which a key used only by this Zap avoids.

Tips for Zapier

  • To send only when the list changes, keep the last list of Data Id values with Storage by Zapier, whose steps don't use tasks, and add a second Filter that continues only when the new list differs from the stored one.
  • lastUpdatedAt shows when the utility data behind each county was last read. Records are not zeroed when a utility stops reporting, so an old value next to a recent Meta Generated At means that county may be out of date.
  • Each hourly message lists every county still over the threshold, so set minCustomersOut high enough that a normal day sends nothing; many counties have a few customers out at any time.
  • Check that Zapier's error email notifications are on for the Zap's owner, so a revoked key or a typo in the header reaches someone instead of failing every hour unseen.

Used by

Related integrations

FAQ

Here are some commonly asked questions

Request API access

Tell us what you're building and we'll set you up with a trial key.