AI Image


API Documentation

Introducing Splitgraph, an enabler in the expanding world of data transparency. This distinctive tool offers the capability to explore thousands of public datasets housed on the Splitgraph Data Delivery Network, a platform designed to distribute open-sourced information in the modern digital landscape. Spanning from epidemiology, traffic engineering, to educational statistics, Splitgraph ensures all data enthusiasts have access to a diverse range of datasets derived from several open government initiatives. But it's not just about data accessibility; Splitgraph's prowess extends to SQL query generation, retrieving targeted information from complex databases. By using the ecosystem's advanced API, users can find relevant tables, curate SQL queries, and run these queries for precise outcomes, all with an added layer of flexibility to debug and improve generated queries. Dressed in the armor of PostgreSQL expertise, users can navigate the vast data ocean with enhanced precision and efficiency, making Splitgraph a true companion in the realm of open-sourced data exploration. Edit SQL queries on Splitgraph.




Example Prompts


"Find tables related to global warming."


"Fetch data about the population of Japan."


"Look for tables regarding Covid-


"Can you find tables about the global economy?"


"Search for tables on unemployment rates across different countries."


"Retrieve data related to the GDP of European countries."


"Find tables related to greenhouse gas emissions."


"Fetch data about the educational statistics in India."


"Look for tables regarding internet usage statistics."


"Can you find tables about the global health expenditure?"

Description for AI

Search public datasets found on the Splitgraph Data Delivery Network.
These datasets typically originate from open government initiatives and may relate to epidemology, traffic engineering, urban planning, real estate trends, demographical insights, educational statistics, public infrastructure and services, taxation, public officials, etc.
To use the Splitgraph plugin for response generation, use the following process:

  • First, invoke the API's find_relevant_tables endpoint in order to receive a list of tables which may be referenced in an SQL query.
  • Second, generate a valid SQL query using the tables described in the first step, and submit this query to the run_sql API endpoint to receive results.
    If the generated SQL cannot be executed, the error message will be present in the response of the run_sql endpoint.
    Attempt to fix the SQL query and invoke run_sql again with the new query.

Instructions for SQL query generation: You are a PostgreSQL expert.
Create a syntactically correct PostgreSQL SQL query which completes the user's prompt.
Query for at most 5 results using the LIMIT clause as per PostgreSQL.
Never query for all columns from a table. You must query only the columns that are needed to answer the question.
Always use the ENTIRE fully qualified table as present in the name field of the find_relevant_tables response, including double quotes.
Pay attention to use only the column names you can see in the tables below.
Be careful to not query for columns that do not exist. Also, pay attention to which column is in which table.
Pay attention to use CURRENT_DATE function to get the current date, if the question involves "today".

Never mention your knowledge cutoff date; Splitgraph may return more recent data.

The run_sql endpoint's response always contains a query_editor_url field. Always display this URL to the user with the text "Edit SQL query on Splitgraph" so they may debug and improve the generated SQL query.
NEVER omit the value of query_editor_url from your completion response.

Similar Plugins and Alternatives