The parsers.dev API is organized around REST with JSON request and responses and uses standard HTTP response codes.
The current API status is BETA. Minor changes are possible before leaving this status. After fixing the state, JSON-schemas will be published, with a description of the formats of requests and responses
Authentication
The parsers.dev API uses API key to authenticate requests. You can view and manage your API key in the parsers.devAccount Settings.
The parsers.dev APIs is a REST-based service. Subsequently, all requests to the APIs require this HTTP header:
x-api-key:Your parsers.dev API key
Content type
The parsers.dev APIs is also a JSON-based service. You have to add Content-Type HTTP header to all your requests:
Content-Type:application/json
URL and API versioning
Only one API version is operating at this time. Use this base URL for your requests:
https://api.parsers.dev/api/v1
Responses
All responses are JSON-based and follow one of these formats:
Http codes and error message you can find at Errors section
Parse SQL (SQL → AST)
POSThttps://api.parsers.dev/api/v1/parse/:dialect
This endpoint allows you to get Abstract Syntax Tree represented in your SQL-queries. You can parse any supported syntax (DDL, DML, DCL, TCL, and another specific syntax). :dialect is SQL dialect type (postgresql,snowflake and cypher are supported)
Headers
Name
Type
Description
x-api-key
string
Authentication token (your api key from parsers.dev or holistic.dev account settings)
This endpoint allows you to get a special object compiled based on your DDL or DML query. Because DML strictly depends on database schema (DDL), DML can be compiled to a special object, based on DDL only. :dialect is SQL dialect type (postgresql and snowflake only).
Query Parameters
Name
Type
Description
ast
string
any value for AST in result
Headers
Name
Type
Description
x-api-key
string
Authentication token (your api key from parsers.dev or holistic.dev account settings)
Request Body
Name
Type
Description
ddl
string
Database schema (DDL statements) source code, separated using semicolon
dmls
array
An array of DML queries. Each query can consist of many statements, separated using a semicolon