A free key value API: store JSON and counters with a fetch call
5 min read · Updated October 21, 2026
Sometimes you only need to keep a small piece of data somewhere a website or script can reach: a feature flag, a visitor counter, a list of settings or a bit of JSON. Building a backend for that is a lot of work. With KVA you create an API in one click, copy its link and token and call it with an ordinary request. This guide shows the steps and the calls.
Create the API
- Open KVA and choose Create API: give it a name.
- Choose the value type: each API holds one type, either true or false, a number, text or JSON. Every write is checked, so a number API never receives text by mistake.
- Choose who can use it: a token keeps it private, while an open API can be used by anyone with the link, which suits public counters. You can allow reading, writing or both.
- Save and copy the link and the token: the token is shown once, so store it somewhere safe.
Write and read a value
Every key lives at the API link followed by the key name. Write a value with a PUT request and a JSON body with a value field, and read it back with a GET request. Replace the API id and the token with your own.
curl -X PUT https://softwaretrinkets.com/api/kva/v1/YOUR_API_ID/welcome-banner \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"value": true}'Use it from a web page
The answers carry CORS headers, so a plain fetch works from the browser. Keep in mind that anything in browser code can be read by visitors: for anything private, call the API from your own server and keep the token there.
const res = await fetch("https://softwaretrinkets.com/api/kva/v1/YOUR_API_ID/welcome-banner", {
headers: { Authorization: "Bearer YOUR_TOKEN" },
});
const data = await res.json();Good uses
- Feature flags: turn a feature on for everyone without a new deploy.
- Counters: count visits, clicks or downloads, with an increment call.
- Settings: keep a small JSON document that several apps read.
- Temporary data: give keys an expiry so they clean themselves up.
What it costs
Creating an API costs a small number of credits that depends on the value type, and new accounts start with free credits. Using an API, reading and writing keys, never costs credits. Requests per minute, keys per API and the size of a value depend on your plan, and paid plans include free APIs.
Try it yourself
Start free: new accounts get credits, and the free plan tops them up every week.
Questions about this guide
- Do I need to run my own backend?
- No. We run the storage, the limits and the CORS headers. You create an API, copy its link and token and call it from your code.
- Can I see who used my API?
- On paid plans you can turn on request logging, with a daily chart and the latest requests. Each logged request costs a small number of credits.