1.0.1 • Published 3 years ago

public-api.js v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

public-api.js

public-api.js utilizes the public api for public api's

Installation

npm i public-api.js

Usage

const {GetEntries, GetRandom, GetCategories, CheckHealth} = require("public-api.js")

Functions

GetEntries

List all entries currently cataloged in the project

Parameters

ParameterTypeData TypeDescriptionRequired
titlequerystringname of entry (matches via substring - i.e. "at" would return "cat" and "atlas")No
descriptionquerystringdescription of entry (matches via substring)No
authquerystringauth type of entry (can only be values matching in project or null)No
httpsqueryboolreturn entries that support HTTPS or notNo
corsquerystringCORS support for entry ("yes", "no", or "unknown")No
categoryquerystringreturn entries of a specific categoryNo

For categories like "Science & Math" which have a space and an ampersand, the query is simply the first word. Using "Science & Math" as an example, the correct query would be category=science

GetRandom

List a single entry selected at random

Parameters

ParameterTypeData TypeDescriptionRequired
titlequerystringname of entry (matches via substring - i.e. "at" would return "cat" and "atlas")No
descriptionquerystringdescription of entry (matches via substring)No
authquerystringauth type of entry (can only be values matching in project or null)No
httpsqueryboolreturn entries that support HTTPS or notNo
corsquerystringCORS support for entry ("yes", "no", or "unknown")No
categoryquerystringreturn entries of a specific categoryNo

GetCategories

List all categories

Parameters

None

CheckHealth

Check health of the running service

Parameters

None