JSON Keeper API guide
How do I save JSON with curl?
First fetch the homepage and keep its session cookie and CSRF token, as the web form does. Run these commands in the same shell, in a working directory where the two temporary files can be saved:
curl --cookie-jar jsonkeeper-cookies.txt \
--output jsonkeeper-home.html 'https://jsonkeeper.com/'
csrf_token=$(sed -n 's/.*name="csrf-token" content="\([^"]*\)".*/\1/p' jsonkeeper-home.html)
Then POST to /hostings with the same cookie and token. Set Accept: application/json and send a form field named data containing your JSON string.
curl --request POST 'https://jsonkeeper.com/hostings' \
--cookie jsonkeeper-cookies.txt \
--header "X-CSRF-Token: $csrf_token" \
--header 'Accept: application/json' \
--data-urlencode 'data={"message":"Hello from JSON Keeper"}'
The response contains a url field. For example (illustrative identifier):
{"url":"https://jsonkeeper.com/b/ABCDE"}
How do I read hosted JSON?
Send GET to the exact URL returned by the save request. Replace the example URL below with your own returned URL.
curl 'https://jsonkeeper.com/b/ABCDE'
A successful request returns your saved JSON. A missing or taken-down bin returns HTTP 404. Anyone with a bin URL can read it; only upload data you intend to share publicly.
How do I edit saved JSON?
Sign in to manage documents in the web interface. The public bin URL retrieves JSON; it is not an edit endpoint.
For more answers, read the FAQ or contact JSON Keeper.
Published: . Last updated: