This service provides the ability to create and query sqlite3 databases through a web API.

https://api.freedb.me

/db

Create a database

  • method: POST
  • response: JSON object with a token

example

$ curl -x POST https://api.freedb.me/db
# response: {"token": "abcdefg"}

/q

Query a database

  • method: POST
  • body: JSON body containing the following
    • token: string, your token
    • query: string, query to execute
    • params: (optional) array, if query contains parameter placeholders (ie ?) provide this array of parameters in order of placeholders.
  • response: JSON array, list of query results

examples

Basic query

$ curl -X POST -d '{"token": "your-token", "query": "INSERT INTO users (name) VALUES (\"ted\")"}' https://api.freedb.me/q

# response: []

Parameterized query

$ curl -X POST -d '{"token": "your-token", "query": "SELECT * FROM users WHERE id = ?", "params": [1]}' https://api.freedb.me/q

# response: [{"id":1,"name":"ted"}]

Made by Ted