Skip to content

ianweatherburn/EskomSePushAPI

Repository files navigation

 

EskomSePushAPI

A Swift Wrapper for the EskomSePush load-shedding API 2.0

language Swift 5.8

EskomSePush API access requires a paid API Subscription (or the free* version for 50 requests per day). You can purchase an API key on Gumroad. You must agree to the EskomSePush API License Agreement.

  • If running the included EskomSePushAPITests, you can provide your own token in EskomSePushAPITests.Constants.API.token
  • You must provide your own token when calling this API, in the EskomSePushAPI.init():
    • Each Token is allocated a Quota (typically Daily usage); once this usage has been exceeded; requests will be blocked until quota is available
    • Do not share your Token
    • You should only be doing requests from a single IP (not multiple simultaneously)
    • Each individual must have their own Token linked to a valid email address
  • *The free version is not for Business

EskomSePush Features:

  • Real time status for National Loadshedding
  • Real time status per Area, Upcoming Events & Schedule
  • Areas Search by Text
  • Areas Nearby by GPS coordinates
  • User Generated Topics by approx GPS location

Swift EskomSePushAPI Features:

  • Status: The current and next loadshedding statuses for South Africa and (Optional) municipal overrides
  • Area Information: This single request has everything you need to monitor upcoming loadshedding events for the chosen suburb.
  • Area Nearby (GPS): Find areas based on GPS coordinates (latitude and longitude).
  • Areas Search (Text): Search for an area based on text.
  • Topics Nearby: Find topics created by users based on GPS coordinates (latitude and longitude). Can use this to detect if there is a potential outage/problem nearby.
  • Check Allowance: Check allowance allocated for token. NOTE: This call doesn't count towards your quota.

Usage

See the test project for usage

Swift Package Manager

You can use Xcode 11 or later to integrate EskomSePushAPI into your project using Swift Package Manager.

To integrate EskomSePushAPI into your Xcode project using Swift Package Manager. Select File > Swift Packages > Add Package Dependency....

When prompted, simply search for EskomSePushAPI or specify the project's GitHub repository:

[email protected]:IanWeatherburn/EskomSePushAPI.git

License

The MIT License (MIT)

Copyright (c) 2023 Ian Weatherburn

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Releases

No releases published

Packages

No packages published

Languages