0.1.14 • Published 2 years ago

@re621/zestyapi v0.1.14

Weekly downloads
-
License
GPLv3
Repository
github
Last release
2 years ago

ZestyAPI

Releases checks Issues Pull Requests

ZestyAPI is a JavaScript wrapper for the public API on e621.net.
It can be used as a node package, as well as in a browser.

const E621 = ZestyAPI.connect({ userAgent: "zesty/example" });
E621.Posts.get(12345).then((result) => console.log(result));

Usage

ZestyAPI is instantiated via the connect() method. An object will be returned, through which endpoints can be accessed.

Options

OptionTypeDefaultRequiredNotes
userAgentstringyesUser-agent used for requests to the API. Required.
rateLimitnumber500noHow quickly requests can be sent (ms). 500 minimum.
domainstringhttps://e621.netnoBase for building API requests. Must be a valid URL.
debugbooleanfalsenoEnables debug messages in the log.

User-Agent

Note that a custom userAgent is required by the e621 API for all requests.

Please, pick a descriptive User-Agent for your project.
You are encouraged to include your e621 username so that you may be contacted if your project causes problems.
Do NOT impersonate a browser user agent, as this will result in you being blocked.
An example user-agent would be MyProject/1.0 (by username on e621).

Authentication

When used in a browser on e621.net, you may use the CSRF token available throw a meta-tag in order to authenticate.
Otherwise, you may need to use the username / api key pair.

Authentication is done by calling a <instance>.login() method, and passing the credentials to it.
CSRF token may be passed as-is:

const E621 = ZestyAPI.connect({ userAgent: "zesty/example" });
E621.login("your-csrf-token-here");

Meanwhile, the username / key pair must be passed as an object:

const E621 = ZestyAPI.connect({ userAgent: "zesty/example" });
E621.login({
    username: YourUsername,
    apiKey: YourAPIKey
});
0.1.10

2 years ago

0.1.11

2 years ago

0.1.12

2 years ago

0.1.13

2 years ago

0.1.14

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.9

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.1

2 years ago

0.0.4

2 years ago