public-api.js
Version:
public-api.js utilizes the public api for public api's
58 lines (42 loc) • 1.98 kB
Markdown
# public-api.js
public-api.js utilizes the public api for public api's
# Installation
```bash
npm i public-api.js
```
# Usage
```javascript
const {GetEntries, GetRandom, GetCategories, CheckHealth} = require("public-api.js")
```
# Functions
## GetEntries
*List all entries currently cataloged in the project*
### Parameters
Parameter | Type | Data Type | Description | Required
| --- | --- | --- | --- | --- |
| title | query | string | name of entry (matches via substring - i.e. "at" would return "cat" and "atlas") | No |
| description | query | string | description of entry (matches via substring) | No |
| auth | query | string | auth type of entry (can only be values matching in project or null) | No |
| https | query | bool | return entries that support HTTPS or not | No |
| cors | query | string | CORS support for entry ("yes", "no", or "unknown") | No |
| category | query | string | return entries of a specific category | No |
> 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
Parameter | Type | Data Type | Description | Required
| --- | --- | --- | --- | --- |
| title | query | string | name of entry (matches via substring - i.e. "at" would return "cat" and "atlas") | No |
| description | query | string | description of entry (matches via substring) | No |
| auth | query | string | auth type of entry (can only be values matching in project or null) | No |
| https | query | bool | return entries that support HTTPS or not | No |
| cors | query | string | CORS support for entry ("yes", "no", or "unknown") | No |
| category | query | string | return entries of a specific category | No |
## GetCategories
*List all categories*
### Parameters
None
## CheckHealth
*Check health of the running service*
### Parameters
None