APIYard
Back to APIs
DatabaseBearer TokenFree tier

Turso

Turso provides edge-hosted SQLite databases powered by libSQL — query via HTTP anywhere, replicate globally, and embed databases close to your users.

Base URL

https://{database}-{org}.turso.io
SQLiteedgelibSQLreplicatedserverless

Endpoints

POST/v2/pipeline

Execute SQL statements against a Turso database.

const response = await fetch("https://your-db-org.turso.io/v2/pipeline", {
  method: "POST",
  headers: {
  "Content-Type": "application/json",
  "Authorization": "Bearer YOUR_ACCESS_TOKEN"
  },
  body: JSON.stringify({
  "requests": [
    {
      "type": "execute",
      "stmt": {
        "sql": "SELECT * FROM users LIMIT 10"
      }
    }
  ]
})
});

const data = await response.json();
console.log(data);

Response Preview

{
  "results": [{
    "type": "ok",
    "response": {
      "type": "execute",
      "result": {
        "cols": [{ "name": "id" }, { "name": "email" }],
        "rows": [["1", "alice@example.com"]]
      }
    }
  }]
}