{"id":5067,"date":"2026-05-31T16:22:23","date_gmt":"2026-05-31T22:22:23","guid":{"rendered":"https:\/\/querystreams.com\/?post_type=docs&#038;p=5067"},"modified":"2026-11-10T12:54:17","modified_gmt":"2026-11-10T18:54:17","password":"","slug":"instant-rest-api-for-sql-databases","status":"publish","type":"docs","link":"https:\/\/querystreams.com\/pt\/docs\/instant-rest-api-for-sql-databases\/","title":{"rendered":"API REST de banco de dados: transforme qualquer consulta SQL em um endpoint."},"content":{"rendered":"\n<article class=\"qs-d qs-d--api\" data-src=\"database\" data-dest=\"api\" style=\"--qs-src:102 192 163;--qs-src-deep:19 50 59;--qs-src-ink:26 122 97;--qs-src-tint:#8ed6bd;--qs-dst:59 130 246;--qs-dst-tint:#93C5FD\">\n<header class=\"qs-d-hero\"><div class=\"qs-d-hero__pair\" aria-hidden=\"true\"><img decoding=\"async\" class=\"src\" src=\"https:\/\/querystreams.com\/wp-content\/uploads\/2026\/08\/database-150x150.png\" alt=\"\" width=\"44\" height=\"44\" loading=\"eager\"><i class=\"fa-solid fa-arrow-right\"><\/i><img decoding=\"async\" class=\"dst\" src=\"https:\/\/querystreams.com\/wp-content\/uploads\/2026\/08\/database-rest-api.128.png\" alt=\"\" width=\"44\" height=\"44\" loading=\"eager\"><\/div><span class=\"qs-d-eyebrow\">Database REST API &middot; the hub<\/span><p class=\"qs-d-hero__title\">Turn any <em class=\"src\">SQL query<\/em> into a <em class=\"dst\">REST API<\/em> endpoint<\/p><p class=\"qs-d-hero__sub\">Write a query in Query Builder against any of the 59 connectors, click <strong>New endpoint<\/strong>, and you have a URL at api.querystreams.com with its own key. The SQL runs read-only on the Agent that already sits with your data; callers get JSON or CSV and never see the SQL, the schema or a credential. No server to host, no port to open, and every plan including Free has it. This page is the overview; each connector has its own guide below.<\/p><div class=\"qs-d-hero__meta\"><span class=\"qs-d-pill\"><i class=\"fa-solid fa-clock\"><\/i> About 90 seconds from a saved query<\/span><span class=\"qs-d-pill\"><i class=\"fa-solid fa-server\"><\/i> No server to host<\/span><span class=\"qs-d-pill src\"><i class=\"fa-solid fa-shield-halved\"><\/i> Data stays on your network<\/span><span class=\"qs-d-pill\"><i class=\"fa-solid fa-key\"><\/i> One key per caller, revoke anytime<\/span><\/div><\/header>\n<div class=\"qs-d-support\" data-zone=\"mint\" data-qs-seen=\"support\"><span class=\"qs-d-chip\"><i class=\"fa-solid fa-life-ring\"><\/i><\/span><div class=\"qs-d-support__body\"><strong>Stuck at any point? Just ask us.<\/strong> Open <a href=\"https:\/\/my.querystreams.com\/support\" target=\"_blank\" rel=\"noopener\" data-qs-cta=\"support\">Support<\/a> in Query Streams (top-right menu &rarr; Support) and send us a message. Real people read it, and &ldquo;I don&rsquo;t know what this screen is asking for&rdquo; is a perfectly good question.<\/div><\/div>\n\n<h2 id=\"result\">What you&rsquo;ll end up with<\/h2>\n<p class=\"qs-d-lead\">A URL that returns the rows of a saved query to anyone holding a key, tested from the console in the portal before you share it. Like this:<\/p>\n<div class=\"qs-d-console\" data-qs-seen=\"console\" aria-label=\"The Query Streams API console: a POST request to an endpoint URL, one parameter, and a 200 OK JSON response with columns, rows and meta from your own database\"><div class=\"qs-d-console__bar\"><span class=\"qs-d-console__method\">POST<\/span><span class=\"qs-d-console__url\">api.querystreams.com\/v1\/endpoints\/8f2c4d1e-6b3a-4f7e-9c21-5d0a7b3e2f19<\/span><button type=\"button\" class=\"qs-d-console__btn ghost\" data-copy=\"https:\/\/api.querystreams.com\/v1\/endpoints\/8f2c4d1e-6b3a-4f7e-9c21-5d0a7b3e2f19\"><i class=\"fa-regular fa-copy\" aria-hidden=\"true\"><\/i> <span>Copy URL<\/span><\/button><button type=\"button\" class=\"qs-d-console__btn send\" data-send><i class=\"fa-solid fa-paper-plane\" aria-hidden=\"true\"><\/i> Send<\/button><\/div><div class=\"qs-d-console__tabs\" role=\"tablist\"><button type=\"button\" role=\"tab\" class=\"is-on\" aria-selected=\"true\" data-tab=\"params\">Params<\/button><button type=\"button\" role=\"tab\" aria-selected=\"false\" data-tab=\"body\">Body<\/button><button type=\"button\" role=\"tab\" aria-selected=\"false\" data-tab=\"headers\">Headers<\/button><button type=\"button\" role=\"tab\" aria-selected=\"false\" data-tab=\"code\">Code<\/button><\/div><div class=\"qs-d-console__pane is-on\" data-pane=\"params\"><table class=\"qs-d-console__params\"><thead><tr><th>Key<\/th><th>Value<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>city<\/code> <em>string<\/em> <i>Optional<\/i><\/td><td>Seattle<\/td><td>Callable filter from the saved query<\/td><\/tr><tr class=\"hdr\"><td><code>X-API-Key<\/code><\/td><td>qsapi_AB&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;<\/td><td>Your secret token<\/td><\/tr><\/tbody><\/table><\/div><div class=\"qs-d-console__pane\" data-pane=\"body\"><pre class=\"qs-d-code__body qs-d-console__body\">{\n  <span class=\"k\">&quot;city&quot;<\/span>: <span class=\"s\">&quot;Seattle&quot;<\/span>\n}<\/pre><\/div><div class=\"qs-d-console__pane\" data-pane=\"headers\"><table class=\"qs-d-console__params\"><thead><tr><th>Header<\/th><th>Value<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>X-API-Key<\/code><\/td><td>qsapi_AB&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;<\/td><td>Your secret token. One per caller, revoke anytime.<\/td><\/tr><tr><td><code>Content-Type<\/code><\/td><td>application\/json<\/td><td>The parameters travel as a JSON body<\/td><\/tr><tr><td><code>Accept<\/code><\/td><td>application\/json<\/td><td>JSON back; ask for text\/csv and you get CSV<\/td><\/tr><\/tbody><\/table><\/div><div class=\"qs-d-console__pane\" data-pane=\"code\"><pre class=\"qs-d-code__body qs-d-console__body\">curl -X POST &quot;https:\/\/api.querystreams.com\/v1\/endpoints\/8f2c4d1e-6b3a-4f7e-9c21-5d0a7b3e2f19&quot; \\\n  -H &quot;X-API-Key: qsapi_YOUR_KEY&quot; \\\n  -H &quot;Content-Type: application\/json&quot; \\\n  -d &#039;{&quot;city&quot;: &quot;Seattle&quot;}&#039;<\/pre><\/div><div class=\"qs-d-console__resp\"><div class=\"qs-d-console__badges\"><span class=\"ok\">Status <b>200 OK<\/b><\/span><span>Time <b data-time>84 ms<\/b><\/span><span>Size <b>412 B<\/b><\/span><span>Truncated <b>no<\/b><\/span><\/div><div class=\"qs-d-console__rtabs\" role=\"tablist\"><button type=\"button\" role=\"tab\" class=\"is-on\" aria-selected=\"true\" data-tab=\"rbody\">Body<\/button><button type=\"button\" role=\"tab\" aria-selected=\"false\" data-tab=\"rheaders\">Headers<\/button><\/div><div class=\"qs-d-console__pane is-on\" data-pane=\"rbody\"><pre class=\"qs-d-code__body qs-d-console__body\">{\n  <span class=\"k\">&quot;columns&quot;<\/span>: [ { <span class=\"k\">&quot;name&quot;<\/span>: <span class=\"s\">&quot;customer_id&quot;<\/span>, <span class=\"k\">&quot;type&quot;<\/span>: <span class=\"s\">&quot;integer&quot;<\/span> }, { <span class=\"k\">&quot;name&quot;<\/span>: <span class=\"s\">&quot;name&quot;<\/span>, <span class=\"k\">&quot;type&quot;<\/span>: <span class=\"s\">&quot;string&quot;<\/span> }, { <span class=\"k\">&quot;name&quot;<\/span>: <span class=\"s\">&quot;city&quot;<\/span>, <span class=\"k\">&quot;type&quot;<\/span>: <span class=\"s\">&quot;string&quot;<\/span> } ],\n  <span class=\"k\">&quot;rows&quot;<\/span>: [\n    { <span class=\"k\">&quot;customer_id&quot;<\/span>: <span class=\"n\">1042<\/span>, <span class=\"k\">&quot;name&quot;<\/span>: <span class=\"s\">&quot;Northwind Traders&quot;<\/span>, <span class=\"k\">&quot;city&quot;<\/span>: <span class=\"s\">&quot;Seattle&quot;<\/span> },\n    { <span class=\"k\">&quot;customer_id&quot;<\/span>: <span class=\"n\">1057<\/span>, <span class=\"k\">&quot;name&quot;<\/span>: <span class=\"s\">&quot;Alpine Outfitters&quot;<\/span>, <span class=\"k\">&quot;city&quot;<\/span>: <span class=\"s\">&quot;Denver&quot;<\/span> },\n    { <span class=\"k\">&quot;customer_id&quot;<\/span>: <span class=\"n\">1063<\/span>, <span class=\"k\">&quot;name&quot;<\/span>: <span class=\"s\">&quot;Harbour Foods&quot;<\/span>, <span class=\"k\">&quot;city&quot;<\/span>: <span class=\"s\">&quot;Halifax&quot;<\/span> }\n  ],\n  <span class=\"k\">&quot;meta&quot;<\/span>: { <span class=\"k\">&quot;row_count&quot;<\/span>: <span class=\"n\">3<\/span>, <span class=\"k\">&quot;agent_duration_ms&quot;<\/span>: <span class=\"n\">41<\/span>, <span class=\"k\">&quot;request_id&quot;<\/span>: <span class=\"s\">&quot;req_7Hq2mKd9&quot;<\/span> }\n}<\/pre><\/div><div class=\"qs-d-console__pane\" data-pane=\"rheaders\"><table class=\"qs-d-console__params\"><thead><tr><th>Header<\/th><th>Value<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>content-type<\/code><\/td><td>application\/json; charset=utf-8<\/td><td>The envelope on the Body tab<\/td><\/tr><tr><td><code>content-length<\/code><\/td><td>412<\/td><td>Bytes returned; the Size badge above<\/td><\/tr><\/tbody><\/table><\/div><\/div><div class=\"qs-d-console__foot\"><span><i class=\"fa-solid fa-lock\"><\/i> Read-only: one saved query, nothing else<\/span><span><i class=\"fa-solid fa-eye-slash\"><\/i> SQL never leaves your account<\/span><span><i class=\"fa-solid fa-list-check\"><\/i> Every call on the Activity tab<\/span><\/div><\/div><script>(function(){document.addEventListener(\"click\",function(ev){var t=ev.target.closest(\".qs-d-console [data-tab],.qs-d-console [data-copy],.qs-d-console [data-send]\");if(!t)return;var con=t.closest(\".qs-d-console\");if(t.hasAttribute(\"data-tab\")){var list=t.parentNode,id=t.getAttribute(\"data-tab\");list.querySelectorAll(\"[data-tab]\").forEach(function(b){var on=b===t;b.classList.toggle(\"is-on\",on);b.setAttribute(\"aria-selected\",on?\"true\":\"false\");});var scope=list.classList.contains(\"qs-d-console__rtabs\")?list.parentNode:con;scope.querySelectorAll(\":scope > .qs-d-console__pane\").forEach(function(p){p.classList.toggle(\"is-on\",p.getAttribute(\"data-pane\")===id);});return;}if(t.hasAttribute(\"data-copy\")){var lab=t.querySelector(\"span\"),done=function(){lab.textContent=\"Copied\";t.classList.add(\"is-done\");setTimeout(function(){lab.textContent=\"Copy URL\";t.classList.remove(\"is-done\");},1600);};if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(t.getAttribute(\"data-copy\")).then(done,done);}else{done();}return;}if(t.hasAttribute(\"data-send\")){var r=con.querySelector(\".qs-d-console__resp\"),tm=con.querySelector(\"[data-time]\");r.classList.remove(\"is-sent\");void r.offsetWidth;r.classList.add(\"is-sent\");if(tm)tm.textContent=(60+Math.floor(Math.random()*50))+\" ms\";setTimeout(function(){r.classList.remove(\"is-sent\");},700);}},false);})();<\/script>\n<p>Most tools that put a REST API on a database, PostgREST, Hasura, DreamFactory, Directus and the frameworks you would write yourself, expose the schema: every table becomes an endpoint and the caller browses. Query Streams does the opposite. One saved query defines exactly what an endpoint returns. The caller gets those rows and nothing else about how they were produced, and you never run an API server, because the Agent you already have runs the query and api.querystreams.com does the HTTP.<\/p>\n<figure class=\"qs-d-figure\" data-qs-seen=\"flow\"><svg viewBox=\"0 0 900 210\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" role=\"img\" aria-label=\"WHERE THE DATABASE LIVES, holds your own database and the Query Streams Agent. The Agent runs the saved query and streams the rows to api.querystreams.com, which checks the key and answers your app or partner over HTTPS.\"><defs><marker id=\"qsArrowA\" viewBox=\"0 0 10 10\" refX=\"9\" refY=\"5\" markerWidth=\"8\" markerHeight=\"8\" orient=\"auto-start-reverse\"><path d=\"M0,0 L10,5 L0,10 z\" fill=\"#6589A6\"\/><\/marker><\/defs><rect x=\"14\" y=\"14\" width=\"380\" height=\"166\" rx=\"16\" fill=\"#ffffff\" stroke=\"#66c0a3\" stroke-width=\"2\" stroke-dasharray=\"6 5\"\/><text x=\"32\" y=\"38\" font-family=\"Poppins, sans-serif\" font-size=\"11\" font-weight=\"600\" fill=\"#13323b\" letter-spacing=\"1.5\">WHERE THE DATABASE LIVES<\/text><text x=\"32\" y=\"54\" font-family=\"system-ui, sans-serif\" font-size=\"11\" fill=\"#7D8688\">your office network or server room<\/text><rect x=\"36\" y=\"72\" width=\"160\" height=\"78\" rx=\"12\" fill=\"#66c0a3\" fill-opacity=\".12\" stroke=\"#66c0a3\" stroke-width=\"1.5\"\/><text x=\"116\" y=\"104\" text-anchor=\"middle\" font-family=\"Poppins, sans-serif\" font-size=\"14\" font-weight=\"600\" fill=\"#13323b\">Your own database<\/text><text x=\"116\" y=\"126\" text-anchor=\"middle\" font-family=\"system-ui, sans-serif\" font-size=\"12\" fill=\"#66c0a3\">stays on your network<\/text><rect x=\"212\" y=\"72\" width=\"160\" height=\"78\" rx=\"12\" fill=\"#13323B\"\/><text x=\"292\" y=\"104\" text-anchor=\"middle\" font-family=\"Poppins, sans-serif\" font-size=\"14\" font-weight=\"600\" fill=\"#ffffff\">Query Streams Agent<\/text><text x=\"292\" y=\"126\" text-anchor=\"middle\" font-family=\"system-ui, sans-serif\" font-size=\"12\" fill=\"#a9dfcb\">runs the saved query<\/text><line x1=\"198\" y1=\"111\" x2=\"208\" y2=\"111\" stroke=\"#6589A6\" stroke-width=\"2.5\" marker-end=\"url(#qsArrowA)\"\/><line x1=\"394\" y1=\"111\" x2=\"428\" y2=\"111\" stroke=\"#6589A6\" stroke-width=\"2.5\" stroke-dasharray=\"4 4\" marker-end=\"url(#qsArrowA)\"\/><rect x=\"432\" y=\"80\" width=\"110\" height=\"62\" rx=\"31\" fill=\"#3B82F6\"\/><text x=\"487\" y=\"106\" text-anchor=\"middle\" font-family=\"Poppins, sans-serif\" font-size=\"12\" font-weight=\"700\" fill=\"#ffffff\">api.querystreams<\/text><text x=\"487\" y=\"124\" text-anchor=\"middle\" font-family=\"system-ui, sans-serif\" font-size=\"10.5\" fill=\"#dbeafe\">checks the key<\/text><line x1=\"544\" y1=\"111\" x2=\"578\" y2=\"111\" stroke=\"#6589A6\" stroke-width=\"2.5\" stroke-dasharray=\"4 4\" marker-end=\"url(#qsArrowA)\"\/><text x=\"487\" y=\"166\" text-anchor=\"middle\" font-family=\"system-ui, sans-serif\" font-size=\"11\" fill=\"#6589A6\">HTTPS &middot; rows only, never the SQL<\/text><rect x=\"582\" y=\"14\" width=\"304\" height=\"166\" rx=\"16\" fill=\"#ffffff\" stroke=\"#3B82F6\" stroke-width=\"2\" stroke-dasharray=\"6 5\"\/><text x=\"600\" y=\"38\" font-family=\"Poppins, sans-serif\" font-size=\"11\" font-weight=\"600\" fill=\"#1E3A8A\" letter-spacing=\"1.5\">WHOEVER HOLDS A KEY<\/text><text x=\"600\" y=\"54\" font-family=\"system-ui, sans-serif\" font-size=\"11\" fill=\"#7D8688\">your app, a dashboard, a partner, a script<\/text><rect x=\"604\" y=\"72\" width=\"260\" height=\"78\" rx=\"12\" fill=\"#eff6ff\" stroke=\"#bfdbfe\"\/><text x=\"734\" y=\"104\" text-anchor=\"middle\" font-family=\"Poppins, sans-serif\" font-size=\"14\" font-weight=\"600\" fill=\"#1E3A8A\">GET or POST with X-API-Key<\/text><text x=\"734\" y=\"126\" text-anchor=\"middle\" font-family=\"system-ui, sans-serif\" font-size=\"12\" fill=\"#1d4ed8\">JSON, CSV or NDJSON back<\/text><\/svg><figcaption>The Agent lives with your data and runs the query. api.querystreams.com checks the key and rate limit and passes the rows on. The caller never reaches your network.<\/figcaption><\/figure>\n\n<h2 id=\"need\">What you&rsquo;ll need<\/h2>\n<div class=\"qs-d-grid\" data-qs-seen=\"need\"><div class=\"qs-d-card\" data-zone=\"mint\"><span class=\"qs-d-card__bar\"><\/span><span class=\"qs-d-card__blob\"><\/span><span class=\"qs-d-chip\"><i class=\"fa-solid fa-user-plus\"><\/i><\/span><h3>A Query Streams account<\/h3><p>Every plan has the REST API. Free gives you one endpoint, two keys and 250 rows per call, which is enough to build this guide. Sign up at <a href=\"https:\/\/my.querystreams.com\" target=\"_blank\" rel=\"noopener\" data-qs-cta=\"signup\">my.querystreams.com<\/a>.<\/p><\/div><div class=\"qs-d-card\" data-zone=\"src\"><span class=\"qs-d-card__bar\"><\/span><span class=\"qs-d-card__blob\"><\/span><span class=\"qs-d-chip\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/querystreams.com\/wp-content\/uploads\/2026\/08\/database.png\" alt=\"\" width=\"22\" height=\"22\" loading=\"lazy\"><\/span><h3>The Agent on a computer that can reach your own database, with the connection added<\/h3><p>Often the database server itself or an always-on computer on the same network. <\/p><\/div><div class=\"qs-d-card\" data-zone=\"dst\"><span class=\"qs-d-card__bar\"><\/span><span class=\"qs-d-card__blob\"><\/span><span class=\"qs-d-chip\"><i class=\"fa-solid fa-floppy-disk\"><\/i><\/span><h3>A saved query in Query Builder<\/h3><p>The endpoint wraps exactly one saved query. Write the SELECT, run it once, save it. Add a Dynamic Filter (a <code>@variable<\/code> in the WHERE clause) if callers should be able to filter.<\/p><\/div><\/div><div class=\"qs-d-note\" data-zone=\"slate\"><i class=\"fa-solid fa-circle-info\"><\/i><p><strong>Who can create endpoints?<\/strong> Owners, Admins and Creators. If the <strong>API<\/strong> item is missing from your top bar, an Admin can switch it on for your user under <strong>Account &rarr; Permissions<\/strong>. Anyone you share an endpoint with only needs a Query Streams account, on any plan.<\/p><\/div>\n\n<h2 id=\"steps\">Set it up in four steps<\/h2>\n<ol class=\"qs-d-steps\" data-qs-seen=\"steps\">\n    <li class=\"qs-d-step\" data-qs-step=\"1\" id=\"step-1\"><h3>Save the query<\/h3><p>In <a href=\"https:\/\/my.querystreams.com\/query-builder\" target=\"_blank\" rel=\"noopener\" data-qs-cta=\"open_query_builder\"><strong>Query Builder<\/strong><\/a> pick a connection, write the SELECT and run it once. A <code>@variable<\/code> in the WHERE clause becomes an API parameter:<\/p>\n<div class=\"qs-d-code\" data-qs-hover=\"code\"><div class=\"qs-d-code__hdr\">Saved query &middot; with one Dynamic Filter<\/div>\n<pre class=\"qs-d-code__body\" data-lang=\"sql\"><span class=\"k\">SELECT<\/span> customer_id, name, city\n<span class=\"k\">FROM<\/span> customers\n<span class=\"k\">WHERE<\/span> city = @city\n<span class=\"k\">ORDER<\/span> <span class=\"k\">BY<\/span> name;<\/pre><\/div>\n<p>Click <strong>Save<\/strong>; the name becomes the endpoint&rsquo;s display name.<\/p><\/li>\n    <li class=\"qs-d-step\" data-qs-step=\"2\" id=\"step-2\"><h3>Create the endpoint<\/h3><p>Open <a href=\"https:\/\/my.querystreams.com\/api\" target=\"_blank\" rel=\"noopener\" data-qs-cta=\"open_api\"><strong>API<\/strong><\/a> in the top bar, click <strong>New endpoint<\/strong>, and on <strong>Pick query<\/strong> click the query you saved. Click <strong>Next<\/strong>.<\/p><div class=\"qs-d-cta\"><a class=\"qs-d-btn qs-d-btn--primary\" href=\"https:\/\/my.querystreams.com\/api\" target=\"_blank\" rel=\"noopener\" data-qs-cta=\"open_api\"><i class=\"fa-solid fa-plug\"><\/i> Open API<\/a><\/div><\/li>\n    <li class=\"qs-d-step\" data-qs-step=\"3\" id=\"step-3\"><h3>Configure and lock parameters<\/h3><p>On <strong>Configure<\/strong> keep <strong>Lifespan<\/strong> Permanent, <strong>Response mode<\/strong> Static and <strong>Inner format<\/strong> JSON for a first endpoint; mode and format are fixed once created. On <strong>Lock params<\/strong> leave <code>city<\/code> as <strong>Callable<\/strong>, or <strong>Lock<\/strong> it to a fixed value the caller cannot change. Click <strong>Next<\/strong>.<\/p><\/li>\n    <li class=\"qs-d-step\" data-qs-step=\"4\" id=\"step-4\"><h3>Share and get your key<\/h3><p>Invite <strong>People<\/strong> by email, add a <strong>Service key<\/strong> for a tool, or skip for now, then click <strong>Create &amp; get my key<\/strong>. Copy the 49-character key starting <code>qsapi_<\/code>; it can be revealed again later from the <strong>Sharing<\/strong> tab. Click <strong>Send<\/strong> in the console to make the first call.<\/p><\/li>\n<\/ol>\n<div class=\"qs-d-note\" data-zone=\"mint\"><i class=\"fa-solid fa-circle-check\"><\/i><p><strong>That&rsquo;s it.<\/strong> The query answers on a URL, read-only, to the keys you hand out. Each connector guide below walks the same four steps with that connector&rsquo;s own SQL and the things that are particular to it.<\/p><\/div>\n\n<h2 id=\"call\">Call it from anywhere<\/h2>\n<p>Replace the endpoint id with yours and <code>qsapi_YOUR_KEY<\/code> with your key:<\/p>\n<div class=\"qs-d-code\" data-qs-hover=\"code\"><div class=\"qs-d-code__hdr\">GET &middot; parameters in the query string<\/div><pre class=\"qs-d-code__body\">curl &quot;https:\/\/api.querystreams.com\/v1\/endpoints\/8f2c4d1e-6b3a-4f7e-9c21-5d0a7b3e2f19?city=Seattle&quot; \\\n  -H &quot;X-API-Key: qsapi_YOUR_KEY&quot;<\/pre><\/div><div class=\"qs-d-code\" data-qs-hover=\"code\"><div class=\"qs-d-code__hdr\">Response &middot; 200 OK &middot; application\/json<\/div><pre class=\"qs-d-code__body\">{\n  <span class=\"k\">&quot;columns&quot;<\/span>: [ { <span class=\"k\">&quot;name&quot;<\/span>: <span class=\"s\">&quot;customer_id&quot;<\/span>, <span class=\"k\">&quot;type&quot;<\/span>: <span class=\"s\">&quot;integer&quot;<\/span> }, { <span class=\"k\">&quot;name&quot;<\/span>: <span class=\"s\">&quot;name&quot;<\/span>, <span class=\"k\">&quot;type&quot;<\/span>: <span class=\"s\">&quot;string&quot;<\/span> }, { <span class=\"k\">&quot;name&quot;<\/span>: <span class=\"s\">&quot;city&quot;<\/span>, <span class=\"k\">&quot;type&quot;<\/span>: <span class=\"s\">&quot;string&quot;<\/span> } ],\n  <span class=\"k\">&quot;rows&quot;<\/span>: [\n    { <span class=\"k\">&quot;customer_id&quot;<\/span>: <span class=\"n\">1042<\/span>, <span class=\"k\">&quot;name&quot;<\/span>: <span class=\"s\">&quot;Northwind Traders&quot;<\/span>, <span class=\"k\">&quot;city&quot;<\/span>: <span class=\"s\">&quot;Seattle&quot;<\/span> },\n    { <span class=\"k\">&quot;customer_id&quot;<\/span>: <span class=\"n\">1057<\/span>, <span class=\"k\">&quot;name&quot;<\/span>: <span class=\"s\">&quot;Alpine Outfitters&quot;<\/span>, <span class=\"k\">&quot;city&quot;<\/span>: <span class=\"s\">&quot;Denver&quot;<\/span> },\n    { <span class=\"k\">&quot;customer_id&quot;<\/span>: <span class=\"n\">1063<\/span>, <span class=\"k\">&quot;name&quot;<\/span>: <span class=\"s\">&quot;Harbour Foods&quot;<\/span>, <span class=\"k\">&quot;city&quot;<\/span>: <span class=\"s\">&quot;Halifax&quot;<\/span> }\n  ],\n  <span class=\"k\">&quot;meta&quot;<\/span>: { <span class=\"k\">&quot;row_count&quot;<\/span>: <span class=\"n\">3<\/span>, <span class=\"k\">&quot;agent_duration_ms&quot;<\/span>: <span class=\"n\">41<\/span>, <span class=\"k\">&quot;request_id&quot;<\/span>: <span class=\"s\">&quot;req_7Hq2mKd9&quot;<\/span> }\n}<\/pre><\/div><p>Rows come back as objects keyed by column name, with the column list and a <code>meta<\/code> block that tells you how many rows there are, whether the result was clipped, and the request id you can quote to support. The same call as a POST puts the parameters in a JSON body, which is the right choice for long lists of values:<\/p><div class=\"qs-d-code\" data-qs-hover=\"code\"><div class=\"qs-d-code__hdr\">POST &middot; parameters in a JSON body<\/div><pre class=\"qs-d-code__body\">curl -X POST &quot;https:\/\/api.querystreams.com\/v1\/endpoints\/8f2c4d1e-6b3a-4f7e-9c21-5d0a7b3e2f19&quot; \\\n  -H &quot;X-API-Key: qsapi_YOUR_KEY&quot; \\\n  -H &quot;Content-Type: application\/json&quot; \\\n  -d &#039;{&quot;params&quot;: {&quot;city&quot;: &quot;Seattle&quot;}}&#039;<\/pre><\/div><dl class=\"qs-d-kv\"><dt><code>?format=csv<\/code><\/dt><dd>CSV instead of JSON, header row included. <code>Accept: text\/csv<\/code> does the same. Streaming endpoints return NDJSON (one JSON object per line) with a final <code>{\"_summary\": true, \"row_count\": N}<\/code> line; check that last line.<\/dd><dt><code>?sample=true<\/code><\/dt><dd>At most five rows, not billed. Good for wiring up a client.<\/dd><dt><code>?compression=lz4<\/code><\/dt><dd>An LZ4-frame body for high-volume callers with a decoder; the <strong>Code<\/strong> tab has the decoder snippet per language. Plain gzip happens on its own when your client sends <code>Accept-Encoding: gzip<\/code>.<\/dd><dt><code>Authorization: Bearer qsapi_\u2026<\/code><\/dt><dd>Accepted as an alias for <code>X-API-Key<\/code>. Use it from browser code.<\/dd><\/dl>\n\n<h2 id=\"use\">Where it plugs in<\/h2>\n<div class=\"qs-d-grid\" data-qs-seen=\"use\"><div class=\"qs-d-card\" data-zone=\"dst\"><span class=\"qs-d-card__bar\"><\/span><span class=\"qs-d-chip\"><i class=\"fa-solid fa-table\"><\/i><\/span><h3>Excel and Power BI<\/h3><p><strong>Export &rarr; Power Query M (.pq)<\/strong> gives you a ready-made query. Paste it into the Advanced Editor (Excel: Data &rarr; Get Data &rarr; From Other Sources &rarr; Blank Query; Power BI: Home &rarr; Transform data &rarr; New Source &rarr; Blank Query) and replace the placeholder with your <code>qsapi_<\/code> key.<\/p><\/div><div class=\"qs-d-card\" data-zone=\"slate\"><span class=\"qs-d-card__bar\"><\/span><span class=\"qs-d-chip\"><i class=\"fa-solid fa-flask\"><\/i><\/span><h3>Postman, Insomnia, Hoppscotch<\/h3><p>The same <strong>Export<\/strong> menu downloads a Postman v2.1 collection, an Insomnia v5 export or a Hoppscotch collection with the parameters filled in and a placeholder for the key.<\/p><\/div><div class=\"qs-d-card\" data-zone=\"mint\"><span class=\"qs-d-card__bar\"><\/span><span class=\"qs-d-chip\"><i class=\"fa-solid fa-code\"><\/i><\/span><h3>Your own code<\/h3><p>The <strong>Code<\/strong> tab has working samples for cURL, Python, JavaScript, TypeScript, Java, C#, Go, PHP, PowerShell and Ruby. <strong>Export &rarr; OpenAPI 3.1 spec<\/strong> feeds any client generator or Swagger UI.<\/p><\/div><div class=\"qs-d-card\" data-zone=\"src\"><span class=\"qs-d-card__bar\"><\/span><span class=\"qs-d-chip\"><i class=\"fa-solid fa-robot\"><\/i><\/span><h3>n8n, Zapier, Make, cron<\/h3><p>Create a <strong>Service key<\/strong> for the tool, paste the URL and the key into its HTTP node, and schedule it. Each tool gets its own key, so you can revoke one without touching the others.<\/p><\/div><\/div>\n\n<h2 id=\"guides\">Guides by connector<\/h2>\n<p>Every connector Query Streams supports can be published this way. Pick yours:<\/p>\n<h3>Databases you run<\/h3>\n<ul class=\"qs-d-related qs-d-related--cols\">\n<li><a href=\"https:\/\/querystreams.com\/docs\/expose-sql-server-as-rest-api\/\" data-qs-cta=\"connector_guide\">Microsoft SQL Server<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/expose-postgresql-as-rest-api\/\" data-qs-cta=\"connector_guide\">PostgreSQL<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/expose-mysql-as-rest-api\/\" data-qs-cta=\"connector_guide\">MySQL<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/expose-mariadb-as-rest-api\/\" data-qs-cta=\"connector_guide\">MariaDB<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/expose-oracle-as-rest-api\/\" data-qs-cta=\"connector_guide\">Oracle<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/expose-sqlite-as-rest-api\/\" data-qs-cta=\"connector_guide\">SQLite<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/expose-microsoft-access-as-rest-api\/\" data-qs-cta=\"connector_guide\">Microsoft Access<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/expose-duckdb-as-rest-api\/\" data-qs-cta=\"connector_guide\">DuckDB<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/supabase-rest-api\/\" data-qs-cta=\"connector_guide\">Supabase<\/a><\/li>\n<\/ul>\n<h3>Data warehouses<\/h3>\n<ul class=\"qs-d-related qs-d-related--cols\">\n<li><a href=\"https:\/\/querystreams.com\/docs\/expose-snowflake-as-rest-api\/\" data-qs-cta=\"connector_guide\">Snowflake<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/expose-bigquery-as-rest-api\/\" data-qs-cta=\"connector_guide\">Google BigQuery<\/a><\/li>\n<\/ul>\n<h3>Hosted databases<\/h3>\n<ul class=\"qs-d-related qs-d-related--cols\">\n<li><a href=\"https:\/\/querystreams.com\/docs\/neon-rest-api\/\" data-qs-cta=\"connector_guide\">Neon<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/amazon-rds-rest-api\/\" data-qs-cta=\"connector_guide\">Amazon RDS<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/azure-database-for-postgresql-rest-api\/\" data-qs-cta=\"connector_guide\">Azure Database for PostgreSQL<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/azure-database-for-mysql-rest-api\/\" data-qs-cta=\"connector_guide\">Azure Database for MySQL<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/azure-sql-rest-api\/\" data-qs-cta=\"connector_guide\">Azure SQL<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/google-cloud-sql-rest-api\/\" data-qs-cta=\"connector_guide\">Google Cloud SQL<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/google-alloydb-rest-api\/\" data-qs-cta=\"connector_guide\">Google AlloyDB<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/digitalocean-managed-databases-rest-api\/\" data-qs-cta=\"connector_guide\">DigitalOcean Managed Databases<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/aiven-rest-api\/\" data-qs-cta=\"connector_guide\">Aiven<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/crunchy-bridge-rest-api\/\" data-qs-cta=\"connector_guide\">Crunchy Bridge<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/heroku-postgres-rest-api\/\" data-qs-cta=\"connector_guide\">Heroku Postgres<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/render-rest-api\/\" data-qs-cta=\"connector_guide\">Render<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/railway-rest-api\/\" data-qs-cta=\"connector_guide\">Railway<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/fly-io-postgres-rest-api\/\" data-qs-cta=\"connector_guide\">Fly.io Postgres<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/vultr-managed-databases-rest-api\/\" data-qs-cta=\"connector_guide\">Vultr Managed Databases<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/ovhcloud-managed-databases-rest-api\/\" data-qs-cta=\"connector_guide\">OVHcloud Managed Databases<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/scaleway-managed-databases-rest-api\/\" data-qs-cta=\"connector_guide\">Scaleway Managed Databases<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/oci-database-with-postgresql-rest-api\/\" data-qs-cta=\"connector_guide\">OCI Database with PostgreSQL<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/mysql-heatwave-rest-api\/\" data-qs-cta=\"connector_guide\">MySQL HeatWave<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/ibm-cloud-databases-for-postgresql-rest-api\/\" data-qs-cta=\"connector_guide\">IBM Cloud Databases for PostgreSQL<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/mariadb-skysql-rest-api\/\" data-qs-cta=\"connector_guide\">MariaDB SkySQL<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/xata-rest-api\/\" data-qs-cta=\"connector_guide\">Xata<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/timescale-cloud-rest-api\/\" data-qs-cta=\"connector_guide\">Timescale Cloud<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/planetscale-postgres-rest-api\/\" data-qs-cta=\"connector_guide\">PlanetScale Postgres<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/prisma-postgres-rest-api\/\" data-qs-cta=\"connector_guide\">Prisma Postgres<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/koyeb-rest-api\/\" data-qs-cta=\"connector_guide\">Koyeb<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/nile-rest-api\/\" data-qs-cta=\"connector_guide\">Nile<\/a><\/li>\n<\/ul>\n<h3>Folders of files and logs<\/h3>\n<ul class=\"qs-d-related qs-d-related--cols\">\n<li><a href=\"https:\/\/querystreams.com\/docs\/file-system-rest-api\/\" data-qs-cta=\"connector_guide\">File System<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/csv-to-rest-api\/\" data-qs-cta=\"connector_guide\">CSV Folder<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/parquet-folder-rest-api\/\" data-qs-cta=\"connector_guide\">Parquet Folder<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/excel-rest-api\/\" data-qs-cta=\"connector_guide\">Excel Folder<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/sqlite-folder-rest-api\/\" data-qs-cta=\"connector_guide\">SQLite Folder<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/jsonl-folder-rest-api\/\" data-qs-cta=\"connector_guide\">JSONL Folder<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/multi-record-csv-rest-api\/\" data-qs-cta=\"connector_guide\">Multi-record CSV<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/machine-logs-rest-api\/\" data-qs-cta=\"connector_guide\">Machine Logs<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/web-server-logs-rest-api\/\" data-qs-cta=\"connector_guide\">Web Server Logs<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/container-logs-rest-api\/\" data-qs-cta=\"connector_guide\">Container Logs<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/application-logs-rest-api\/\" data-qs-cta=\"connector_guide\">Application Logs<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/system-logs-rest-api\/\" data-qs-cta=\"connector_guide\">System Logs<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/custom-logs-rest-api\/\" data-qs-cta=\"connector_guide\">Custom Logs<\/a><\/li>\n<\/ul>\n<h3>SaaS and API connectors<\/h3>\n<ul class=\"qs-d-related qs-d-related--cols\">\n<li><a href=\"https:\/\/querystreams.com\/docs\/stripe-reporting-api-for-partners\/\" data-qs-cta=\"connector_guide\">Stripe<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/shopify-data-rest-api\/\" data-qs-cta=\"connector_guide\">Shopify<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/hubspot-data-rest-api\/\" data-qs-cta=\"connector_guide\">HubSpot<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/google-ads-data-rest-api\/\" data-qs-cta=\"connector_guide\">Google Ads<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/google-analytics-4-data-rest-api\/\" data-qs-cta=\"connector_guide\">Google Analytics 4<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/google-search-console-data-rest-api\/\" data-qs-cta=\"connector_guide\">Google Search Console<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/shipstation-data-rest-api\/\" data-qs-cta=\"connector_guide\">ShipStation<\/a><\/li>\n<li><a href=\"https:\/\/querystreams.com\/docs\/itick-data-rest-api\/\" data-qs-cta=\"connector_guide\">iTick<\/a><\/li>\n<\/ul>\n\n<p>Consumer-side guides: <a href=\"https:\/\/querystreams.com\/docs\/power-bi-rest-api\/\" data-qs-cta=\"related\">Power BI and Excel via Power Query M<\/a>.<\/p>\n\n<h2 id=\"plans\">What the plans allow<\/h2>\n<div class=\"qs-d-table__wrap\"><table class=\"qs-d-table qs-d-table--api\" data-qs-seen=\"limits\"><thead><tr><th>Plan<\/th><th>Endpoints<\/th><th>Keys per endpoint<\/th><th>People per endpoint<\/th><th>Rows per call (static)<\/th><th>Rows per call (streaming)<\/th><th>Calls per minute, per key<\/th><\/tr><\/thead><tbody><tr><td>Free<\/td><td>1<\/td><td>2<\/td><td>1<\/td><td>250<\/td><td>250<\/td><td>3<\/td><\/tr><tr><td>Personal Core<\/td><td>2<\/td><td>3<\/td><td>2<\/td><td>5,000<\/td><td>250,000<\/td><td>15<\/td><\/tr><tr><td>Personal Plus<\/td><td>5<\/td><td>5<\/td><td>5<\/td><td>10,000<\/td><td>500,000<\/td><td>30<\/td><\/tr><tr><td>Business Core<\/td><td>5<\/td><td>10<\/td><td>10<\/td><td>50,000<\/td><td>1,000,000<\/td><td>300<\/td><\/tr><tr><td>Business Plus<\/td><td>10<\/td><td>20<\/td><td>25<\/td><td>100,000<\/td><td>5,000,000<\/td><td>600<\/td><\/tr><tr><td>Business Max<\/td><td>25<\/td><td>30<\/td><td>50<\/td><td>250,000<\/td><td>10,000,000<\/td><td>600<\/td><\/tr><tr><td>Enterprise Core<\/td><td>50<\/td><td>50<\/td><td>100<\/td><td>500,000<\/td><td>25,000,000<\/td><td>1,000<\/td><\/tr><tr><td>Enterprise Plus<\/td><td>100<\/td><td>100<\/td><td>250<\/td><td>1,000,000<\/td><td>50,000,000<\/td><td>1,000<\/td><\/tr><tr><td>Enterprise Max<\/td><td>250<\/td><td>200<\/td><td>500<\/td><td>2,500,000<\/td><td>100,000,000<\/td><td>1,500<\/td><\/tr><\/tbody><\/table><\/div><p>Every call also has a fixed 60-second query timeout and an 8 MiB response cap, and the bytes it returns count against your plan&rsquo;s monthly data allowance, the same allowance the Excel and Google Sheets add-ins use. Free has one endpoint and 5 MB a month, which comfortably covers a small table called many times a day. <a href=\"https:\/\/querystreams.com\/pricing\/\" target=\"_blank\" rel=\"noopener\" data-qs-cta=\"pricing\">See the pricing page<\/a> for the allowances by plan.<\/p><div class=\"qs-d-note\" data-zone=\"mint\"><i class=\"fa-solid fa-gift\"><\/i><p><strong>Free is a plan you keep.<\/strong> It is not a trial that expires. See exactly what it includes on the <a href=\"https:\/\/querystreams.com\/pricing\/\" target=\"_blank\" rel=\"noopener\" data-qs-cta=\"pricing\">pricing page<\/a>.<\/p><\/div>\n\n<h2 id=\"safety\">Keeping it safe<\/h2>\n<div class=\"qs-d-grid\" data-qs-seen=\"safety\"><div class=\"qs-d-card\" data-zone=\"src\"><span class=\"qs-d-card__bar\"><\/span><span class=\"qs-d-chip\"><i class=\"fa-solid fa-eye-slash\"><\/i><\/span><h3>The SQL stays yours<\/h3><p>Callers get rows. They never see the query, the table names or the connection details, and they cannot change what the endpoint runs.<\/p><\/div><div class=\"qs-d-card\" data-zone=\"dst\"><span class=\"qs-d-card__bar\"><\/span><span class=\"qs-d-chip\"><i class=\"fa-solid fa-key\"><\/i><\/span><h3>One key, one endpoint, one caller<\/h3><p>A key works for exactly one endpoint. Give each person or tool their own, and every call is logged against it. Revoke one and the others keep working; revocation takes effect within about five minutes.<\/p><\/div><div class=\"qs-d-card\" data-zone=\"mint\"><span class=\"qs-d-card__bar\"><\/span><span class=\"qs-d-chip\"><i class=\"fa-solid fa-lock\"><\/i><\/span><h3>Read-only, on your side of the wall<\/h3><p>The Agent runs the one saved SELECT and nothing else, from inside your network, over its own outbound connection. There is no port to open and no credential on the internet.<\/p><\/div><div class=\"qs-d-card\" data-zone=\"slate\"><span class=\"qs-d-card__bar\"><\/span><span class=\"qs-d-chip\"><i class=\"fa-solid fa-list-check\"><\/i><\/span><h3>Every call in the ledger<\/h3><p>The <strong>Activity<\/strong> tab shows each call with time, recipient, status, rows, bytes and duration, including refused ones. Set an <strong>Expiring<\/strong> lifespan for a temporary share and the endpoint switches itself off on the date.<\/p><\/div><\/div>\n\n<h2 id=\"trouble\">When something doesn&rsquo;t work<\/h2>\n<div class=\"qs-d-table__wrap\"><table class=\"qs-d-table qs-d-table--api\" data-qs-seen=\"trouble\"><thead><tr><th>Status<\/th><th>Code<\/th><th>What to do<\/th><\/tr><\/thead><tbody><tr><td>401<\/td><td><code>API_KEY_REQUIRED \/ API_KEY_INVALID<\/code><\/td><td>The header is missing or the key is wrong. Send <code>X-API-Key: qsapi_\u2026<\/code>, the whole 49 characters. Keys can be copied again from the endpoint&rsquo;s Sharing tab.<\/td><\/tr><tr><td>403<\/td><td><code>API_KEY_ENDPOINT_MISMATCH<\/code><\/td><td>A valid key used on a different endpoint. Each key belongs to one endpoint.<\/td><\/tr><tr><td>403<\/td><td><code>API_KEY_REVOKED \/ API_ENDPOINT_EXPIRED<\/code><\/td><td>The key was revoked or the endpoint reached its expiry date. Mint a new key or restore the endpoint.<\/td><\/tr><tr><td>400<\/td><td><code>API_PARAM_NOT_OVERRIDABLE<\/code><\/td><td>You sent a parameter the owner did not mark Callable. The body lists the allowed names.<\/td><\/tr><tr><td>414<\/td><td><code>API_QUERY_TOO_LARGE<\/code><\/td><td>The GET query string passed 8 KB or 200 list values. Send the same parameters as a POST JSON body.<\/td><\/tr><tr><td>413<\/td><td><code>API_OUTPUT_TOO_LARGE<\/code><\/td><td>The result passed the 8 MiB cap. Narrow the query, or switch the endpoint to Streaming.<\/td><\/tr><tr><td>429<\/td><td><code>API_RATE_LIMITED<\/code><\/td><td>Too many calls this minute for the key or the endpoint. Wait for the <code>Retry-After<\/code> seconds, or raise <strong>Rate limit<\/strong> under API Settings &rarr; Defaults within your plan.<\/td><\/tr><tr><td>429<\/td><td><code>API_DATA_REALM_EXHAUSTED<\/code><\/td><td>The owner&rsquo;s monthly data allowance is used up. It resets with the billing month; upgrade for more.<\/td><\/tr><tr><td>503<\/td><td><code>API_AGENT_NOT_CONNECTED<\/code><\/td><td>The Agent behind your own database is offline. Check it under Data &rarr; Data Agents; calls succeed again as soon as it reconnects.<\/td><\/tr><tr><td>504<\/td><td><code>API_QUERY_TIMEOUT<\/code><\/td><td>The query took longer than 60 seconds. Add a filter or an index, or save a narrower query.<\/td><\/tr><\/tbody><\/table><\/div><p>Every error body has the shape <code>{\"error\": {\"code\": \"\u2026\", \"message\": \"\u2026\"}}<\/code> and every response carries an <code>X-QS-Request-Id<\/code> header. Quote the id when you write to support.<\/p>\n\n<h2 id=\"faq\">Questions people ask<\/h2>\n<div class=\"qs-d-faq\" data-qs-seen=\"faq\"><details><summary>Does my data get copied to Query Streams?<\/summary><div class=\"qs-d-faq__a\"><p>No. The Agent runs the query where your data is and sends only the rows the call asked for. Nothing is synced or cached in between; every call runs the query.<\/p><\/div><\/details><details><summary>Can callers change the SQL or ask for other tables?<\/summary><div class=\"qs-d-faq__a\"><p>No. An endpoint runs one saved query. Callers can only set the parameters you marked <strong>Callable<\/strong>, and the values are bound safely: text is quoted and escaped, numbers are range-checked, lists are expanded.<\/p><\/div><\/details><details><summary>How do I hand this to a partner?<\/summary><div class=\"qs-d-faq__a\"><p>On the endpoint&rsquo;s <strong>Sharing<\/strong> tab choose <strong>People<\/strong> and enter their email. They get a magic link, sign in with that address (a Free account is fine) and mint their own key; you see their calls by name on the Activity tab. For a server or an automation tool, create an <strong>API key<\/strong> with a label instead.<\/p><\/div><\/details><details><summary>What happens when I edit the saved query?<\/summary><div class=\"qs-d-faq__a\"><p>The endpoint runs the new SQL on the next call and its OpenAPI spec regenerates. The URL and the keys do not change. If you add or remove a filter, revisit <strong>Lock params<\/strong> so callers see the right parameters.<\/p><\/div><\/details><details><summary>Does the Free plan really cover this?<\/summary><div class=\"qs-d-faq__a\"><p>Yes. Free is a plan you keep, not a trial that expires. It includes one endpoint, two keys and 250 rows per call. See exactly what it includes on the <a href=\"https:\/\/querystreams.com\/pricing\/\" target=\"_blank\" rel=\"noopener\" data-qs-cta=\"pricing\">pricing page<\/a>.<\/p><\/div><\/details><\/div>\n<div class=\"qs-d-faq\">\n    <details><summary>How is this different from PostgREST, Hasura or DreamFactory?<\/summary><div class=\"qs-d-faq__a\"><p>Those expose your schema as an API and you host them. Here one saved query is one endpoint, the SQL and the schema stay private, and there is nothing to host: the Agent you already run executes the query and api.querystreams.com serves the HTTP, the keys, the rate limits and the ledger.<\/p><\/div><\/details>\n    <details><summary>Can one endpoint join data from two databases?<\/summary><div class=\"qs-d-faq__a\"><p>Yes. Save a federated (cross-source) query in Query Builder and expose it; federated endpoints run in Static mode.<\/p><\/div><\/details>\n    <details><summary>Can I stream large results?<\/summary><div class=\"qs-d-faq__a\"><p>Choose <strong>Streaming<\/strong> as the response mode when you create the endpoint. Rows arrive as NDJSON or CSV in chunks up to your plan&rsquo;s streaming row cap, with a summary line at the end.<\/p><\/div><\/details>\n<\/div>\n\n<div class=\"qs-d-support qs-d-support--foot\" data-zone=\"mint\" data-qs-seen=\"support\"><span class=\"qs-d-chip\"><i class=\"fa-solid fa-life-ring\"><\/i><\/span><div class=\"qs-d-support__body\"><strong>Still stuck?<\/strong> Open <a href=\"https:\/\/my.querystreams.com\/support\" target=\"_blank\" rel=\"noopener\" data-qs-cta=\"support\">Support<\/a> in Query Streams and tell us which step you are on and what you see. We will get you connected.<\/div><\/div>\n<div class=\"qs-d-cta\"><a class=\"qs-d-btn qs-d-btn--primary\" href=\"https:\/\/my.querystreams.com\" target=\"_blank\" rel=\"noopener\" data-qs-cta=\"signup\"><i class=\"fa-solid fa-user-plus\"><\/i> Create your Free plan account<\/a><a class=\"qs-d-btn qs-d-btn--ghost\" href=\"https:\/\/querystreams.com\/pricing\/\" target=\"_blank\" rel=\"noopener\" data-qs-cta=\"pricing\">See what Free includes<\/a><\/div>\n\n<h2 id=\"related\">Related guides<\/h2>\n<ul class=\"qs-d-related\">\n    <li><a href=\"https:\/\/querystreams.com\/docs\/power-bi-rest-api\/\" data-qs-cta=\"related\">Power BI REST API: connect live SQL data without ODBC drivers<\/a><\/li>\n    <li><a href=\"https:\/\/querystreams.com\/docs\/connect-query-streams-to-claude-mcp\/\" data-qs-cta=\"related\">Connect Query Streams to Claude via MCP<\/a><\/li>\n    <li><a href=\"https:\/\/querystreams.com\/docs\/share-live-data-not-credentials\/\" data-qs-cta=\"related\">Share live data, not credentials<\/a><\/li>\n    <li><a href=\"https:\/\/querystreams.com\/features\/database-rest-api\/\" target=\"_blank\" rel=\"noopener\" data-qs-cta=\"feature\">Database REST API feature overview<\/a><\/li>\n<\/ul>\n<div class=\"qs-d-also\" data-qs-seen=\"also\"><span>The same own connection also feeds<\/span><a href=\"https:\/\/querystreams.com\/features\/databases-in-excel-and-google-sheets\/\" target=\"_blank\" rel=\"noopener\">Excel and Google Sheets<\/a><a href=\"https:\/\/querystreams.com\/features\/mcp-server\/\" target=\"_blank\" rel=\"noopener\">Claude and other AI tools<\/a><a href=\"https:\/\/querystreams.com\/features\/automation-integration\/\" target=\"_blank\" rel=\"noopener\">scheduled Automations<\/a><a href=\"https:\/\/querystreams.com\/features\/\" target=\"_blank\" rel=\"noopener\">and more<\/a><\/div>\n<\/article>\n<script type=\"application\/ld+json\">{\"@context\":\"https:\/\/schema.org\",\"@type\":\"HowTo\",\"name\":\"Database REST API: Turn Any SQL Query into an Endpoint\",\"description\":\"Turn any saved SQL query into a read-only REST API endpoint with Query Streams: no server to host, one key per caller, the SQL kept private.\",\"totalTime\":\"PT2M\",\"step\":[{\"@type\":\"HowToStep\",\"position\":1,\"name\":\"Save the query\",\"url\":\"https:\/\/querystreams.com\/docs\/instant-rest-api-for-sql-databases\/#step-1\"},{\"@type\":\"HowToStep\",\"position\":2,\"name\":\"Create the endpoint\",\"url\":\"https:\/\/querystreams.com\/docs\/instant-rest-api-for-sql-databases\/#step-2\"},{\"@type\":\"HowToStep\",\"position\":3,\"name\":\"Configure and lock parameters\",\"url\":\"https:\/\/querystreams.com\/docs\/instant-rest-api-for-sql-databases\/#step-3\"},{\"@type\":\"HowToStep\",\"position\":4,\"name\":\"Share and get your key\",\"url\":\"https:\/\/querystreams.com\/docs\/instant-rest-api-for-sql-databases\/#step-4\"}]}<\/script>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"doc_category":[244],"doc_tag":[],"class_list":["post-5067","docs","type-docs","status-publish","hentry","doc_category-api-platform"],"year_month":"2026-12","word_count":905,"total_views":"302","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"systemz","author_nicename":"systemz","author_url":"https:\/\/querystreams.com\/pt\/author\/systemz\/"},"doc_category_info":[{"term_name":"Database REST API","term_url":"https:\/\/querystreams.com\/pt\/docs-category\/api-platform\/"}],"doc_tag_info":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"trp-custom-language-flag":false,"betterdocs-category-thumb":false},"uagb_author_info":{"display_name":"systemz","author_link":"https:\/\/querystreams.com\/pt\/author\/systemz\/"},"uagb_comment_info":0,"uagb_excerpt":null,"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/querystreams.com\/pt\/wp-json\/wp\/v2\/docs\/5067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/querystreams.com\/pt\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/querystreams.com\/pt\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/querystreams.com\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/querystreams.com\/pt\/wp-json\/wp\/v2\/comments?post=5067"}],"version-history":[{"count":1,"href":"https:\/\/querystreams.com\/pt\/wp-json\/wp\/v2\/docs\/5067\/revisions"}],"predecessor-version":[{"id":8067,"href":"https:\/\/querystreams.com\/pt\/wp-json\/wp\/v2\/docs\/5067\/revisions\/8067"}],"wp:attachment":[{"href":"https:\/\/querystreams.com\/pt\/wp-json\/wp\/v2\/media?parent=5067"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/querystreams.com\/pt\/wp-json\/wp\/v2\/doc_category?post=5067"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/querystreams.com\/pt\/wp-json\/wp\/v2\/doc_tag?post=5067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}