Key Value Storage API

Read Key Value from Store API

Read a value from the key-value store. The key-value store is a simple storage system that allows you to store and retrieve data using a key. The data is stored in the cloud and can be accessed from anywhere. You can use the key-value store to store any type of data, such as text or numbers. The key-value store is a great way to store data that you want to access from multiple devices or locations.

GET
https://api.apileague.com/read-key-value

Parameters

NameExampleDescription
key
s r q
visitors24hThe key for which the value is stored (max length 255 characters).
api-key
s r q
abcd1234Your API key.
Example Request and Response
GET
https://api.apileague.com/read-key-value?key=visitors24h
{
    "value": "100"
}
 Copy Codecurl -X GET 'https://api.apileague.com/read-key-value?key=visitors24h' \ -H 'x-api-key: myapikey'

Headers

Response Headers:

  • Content-Type: application/json
  • X-API-Quota-Request: The number of tokens used by the request
  • X-API-Quota-Used: The number of tokens used in total today
  • X-API-Quota-Left: The number of tokens left today (depends on your plan)

Quotas

Calling this endpoint costs
1 token
for every 100 chars in the returned value (min. 1 and max. 100 tokens). For example, if the returned value is 'ABC 123' it would be 7/100 and min is 1 so it gets rounded to 1.

Store Key Value (PUT) API

Store a value in the key-value store. The key-value store is a simple storage system that allows you to store and retrieve data using a key. The data is stored in the cloud and can be accessed from anywhere. You can use the key-value store to store any type of data, such as text or numbers. The key-value store is a great way to store data that you want to access from multiple devices or locations.

PUT
https://api.apileague.com/store-key-value

Parameters

NameExampleDescription
key
s r q
visitors24hThe key for which the value is stored (max length 255 characters).
(body)
s r b
{"value": "23578 visitors"}A json object with the "value" that is supposed to be stored (max length 10,000 characters).
api-key
s r q
abcd1234Your API key.
Example Request and Response
PUT
https://api.apileague.com/store-key-value?key=visitors24h
{
    "status": "success"
}

Headers

Response Headers:

  • Content-Type: application/json
  • X-API-Quota-Request: The number of tokens used by the request
  • X-API-Quota-Used: The number of tokens used in total today
  • X-API-Quota-Left: The number of tokens left today (depends on your plan)

Quotas

Calling this endpoint costs
1 token
for every 100 chars in the stored value (min. 3 and max. 100 tokens). For example, if the stored value is 'ABC 123' it would be 7/100 and min is 3 so it gets rounded to 3.

Store Key Value (GET) API

Store a value in the key-value store. The key-value store is a simple storage system that allows you to store and retrieve data using a key. The data is stored in the cloud and can be accessed from anywhere. You can use the key-value store to store any type of data, such as text or numbers. The key-value store is a great way to store data that you want to access from multiple devices or locations.

GET
https://api.apileague.com/store-key-value

Parameters

NameExampleDescription
key
s r q
visitors24hThe key for which the value is stored (max length 255 characters).
value
s r q
23578 visitorsThe value that is supposed to be stored (max length 10,000 characters).
api-key
s r q
abcd1234Your API key.
Example Request and Response
GET
https://api.apileague.com/store-key-value?key=visitors24h&value=100
{
    "status": "success"
}
 Copy Codecurl -X GET 'https://api.apileague.com/store-key-value?key=visitors24h&value=100' \ -H 'x-api-key: myapikey'

Headers

Response Headers:

  • Content-Type: application/json
  • X-API-Quota-Request: The number of tokens used by the request
  • X-API-Quota-Used: The number of tokens used in total today
  • X-API-Quota-Left: The number of tokens left today (depends on your plan)

Frequently Asked Questions

What kind of data can I store?

You can store any type of data that can be represented as a string, such as text, numbers, JSON objects, or configuration settings.

Is the data persistent?

Yes, the data is stored securely in the cloud and remains available until you update or delete it.

Can I access the data from different devices?

Absolutely. Since the data is stored in the cloud, you can access it from any device or application that has the correct API key and key name.

How is the Key Value Storage API different from a traditional database?

The Key Value Storage API is a simple, lightweight cloud storage for storing small pieces of data (like settings or simple states) accessible via a simple API key, whereas a traditional database is for complex, structured data relationships.

Questions? Need Help? Ask Away

Quotas

Calling this endpoint costs
1 token
for every 100 chars in the stored value (min. 3 and max. 100 tokens). For example, if the stored value is 'ABC 123' it would be 7/100 and min is 3 so it gets rounded to 3.