1.0.1 • Published 5 years ago

petition-api v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

petition-api

A simple API for accessing the UK's petitions service.

Usage

import { api } from "petition-api";

// (optionally set the base URL for all requests)
// api.base_api = "";

const petitions = await api.all();

const first = petitions[0];

const detailedPetition = await api.one(first.id);

console.log(`Found ${petitions.length} petitions.`);
console.log({ detailedPetition });