Getting Started with the Query Builder
The DataSift Query Builder has been designed to be easily embeddable on any website, blog, or a mobile or desktop application with a web view. As a matter of fact, we embed it ourselves on our own website. You can do it yourself, as long as you follow our Open Source licensing terms.
We have tried to make it as easy as possible to add the Query Builder to your site, but there are some steps you need to take yourself if you want to integrate the Query Builder into a web page, website, or project:
Read our introduction to the Query Builder and JCSDL.
Make sure that your development and deployment environments meet our basic requirements.
Decide how much customization you are going to do:
If you are planning on making only small changes to the way the Query Builder looks on your site, download the standard distribution archive.
If you want to modify the Query Builder beyond what can be achieved with the basic configuration options, clone or fork the Query Builder project on GitHub and use your repository to build your own installation. To create a local clone of the GitHub repository, use the following command:
git clone https://github.com/datasift/editor.git
- If you are planning on making only small changes to the way the Query Builder looks on your site, download the standard distribution archive.
No matter how you are going to obtain your own copy of the Query Builder, it needs to be installed on your web server or embedded in your project. On a web server that usually means the root document directory or a directory used to store scripts.
Embedding the Query Builder
Once you have a copy of the Query Builder installed on your server, you should create a test page and embed the default configuration to make sure that it work and can communicate with DataSift.
Customizing the Query Builder
Once you can verify that the standard configuration of the Query Builder works, you can either leave it as it is or customize it. There are many ways of customizing the Query Builder, depending on what sort of changes you have in mind:
If you want to modify the way the Query Builder looks, you will have to modify its CSS style sheets and possibly its graphical assets.
When you want to change the initial state of the Query Builder or pre-populate it with queries you need to read the Query Builder configuration guide.
if you need examples of working code, have a look at the ones we provided on our site. Make sure you are logged in to your DataSift account when you try them:
- Saving queries
- Loading queries
- Styling the Query Builder
- Reducing functionality of the Query Builder
- Pre-loading queries into the Query Builder
Advanced customization of the Query Builder
If you want to validate JSCDL you can use the standard /compile DataSift API endpoint.