npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

padam-api

v1.0.0

Published

Official Node.js SDK for Padam.id PLN Outage API

Readme

@padam/api

Official Node.js SDK for the Padam.id PLN Outage API - the first PLN outage API in Indonesia.

Installation

npm install @padam/api

Quick Start

const { PadamClient } = require('@padam/api');

const client = new PadamClient({
  apiKey: 'your_api_key'
});

// Check power outage at a location
const outage = await client.checkOutage(-6.2088, 106.8456);
console.log(outage.data.summary);

// Get meter billing and token estimate
const meter = await client.getMeterSummary({ meter_id: '566601485354' });
console.log(meter.data.consumer_name);

Usage

Initialize Client

const { PadamClient } = require('@padam/api');

const client = new PadamClient({
  apiKey: 'your_api_key',
  baseUrl: 'https://padam.id/api', // optional
  timeout: 10000 // optional, default 10 seconds
});

Check Power Outage

Check for power outages within 500m radius of a location.

const result = await client.checkOutage(-6.2088, 106.8456);

console.log(result.data.summary.total_poles);  // Total poles found
console.log(result.data.summary.poles_on);     // Poles with power
console.log(result.data.summary.poles_off);    // Poles without power
console.log(result.data.summary.has_outage);   // true if any pole is off

// Iterate through poles
result.data.poles.forEach(pole => {
  console.log(`${pole.name}: ${pole.status}`);
});

Get Meter Summary

Get billing history and token estimate for a meter.

// Using meter ID (recommended)
const result = await client.getMeterSummary({ meter_id: '566601485354' });

// Or using account ID
const result = await client.getMeterSummary({ account_id: '8651306' });

console.log(result.data.consumer_name);
console.log(result.data.energy_type);
console.log(result.data.energy);

// Token estimate (prepaid meters)
if (result.data.token_estimate) {
  console.log(`Remaining days: ${result.data.token_estimate.remaining_days}`);
  console.log(`Remaining kWh: ${result.data.token_estimate.remaining_kwh}`);
  console.log(`Daily usage: ${result.data.token_estimate.daily_usage_kwh} kWh`);
}

// Billing history
result.data.billing_history.forEach(entry => {
  console.log(`${entry.date}: Rp ${entry.amount} (${entry.kwh} kWh)`);
});

Error Handling

const { PadamClient, PadamAPIError } = require('@padam/api');

try {
  const result = await client.checkOutage(-6.2088, 106.8456);
} catch (error) {
  if (error instanceof PadamAPIError) {
    console.log(error.code);       // Error code (e.g., 'INSUFFICIENT_CREDITS')
    console.log(error.message);    // Error message
    console.log(error.statusCode); // HTTP status code
  }
}

TypeScript

This package includes TypeScript definitions.

import { PadamClient, OutageCheckResponse, MeterSummaryResponse } from '@padam/api';

const client = new PadamClient({ apiKey: 'your_api_key' });

const outage: OutageCheckResponse = await client.checkOutage(-6.2088, 106.8456);
const meter: MeterSummaryResponse = await client.getMeterSummary({ meter_id: '566601485354' });

API Reference

PadamClient

Constructor

new PadamClient(config: PadamConfig)

| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | required | Your API key | | baseUrl | string | https://padam.id/api | API base URL | | timeout | number | 10000 | Request timeout in ms |

Methods

  • checkOutage(latitude: number, longitude: number) - Check power outage at location
  • getMeterSummary(options: { meter_id?: string, account_id?: string }) - Get meter summary

License

MIT

Author

Akbar Naufal Awalin