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.

Prerequisites

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:

  1. Read our introduction to the Query Builder and JCSDL.

  2. Make sure that your development and deployment environments meet our basic requirements.

  3. 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

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.

Changes that require modification of the source code should be done on a clone of a fork of the Query Builder project.

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:

If you want to validate JSCDL you can use the standard /compile DataSift API endpoint.