Authorization
Make API requests with your account-level API key:
curl -XPOST "https://example.nyan.sh/action" \
-H 'Content-Type: application/json' \ # should be json except where otherwise noted
-H 'X-Api-Key: your_api_key_here' \
-d '{"body":""}'
Make sure to replace
your_api_key_here
with your own key.
Nyan uses an account-level API key for all service access. This key never expires, but can be revoked and regenerated at any time. More authorization options will be made available in the future
You can find your API key in your Account Settings.
KVS
Save or update a key-value pair
Add or update key "keyname" in database "dbname"
curl -XPUT 'https://kvs.nyan.sh/dbname/keyname' \
-H 'Content-Type: text/plain' \ # optional
-H 'Content-Length: 10' \ # required: must be greater than 0 and less than 1048576 (1 MB) for pro, 262144 (256KB) for free
-H 'X-Api-Key: your_api_key_here' \
-d '{"a":true"}'
Nyan offers a simple key-value store as an API. You simply specify a database
(basically a namespace) and a key
in the URL path. The database does not need to already exist. The value is always interpreted as text, though this will change soon. The Content-Length
header must be present.
Database names and key names can contain any character valid in a url as long as they are url-encoded and don't start with a backtick `
.
Get the value stored at a key
Get value at key "keyname" in database "dbname"
curl -XGET 'https://kvs.nyan.sh/dbname/keyname'
Database names and key names can contain any character valid in a url as long as they are url-encoded and don't start with a backtick `
.
Delete a key-value pair
Delete a key
curl -XDELETE 'https://kvs.nyan.sh/dbname/keyname' \
-H 'X-Api-Key: your_api_key_here'