Using the Recipe API
  • 27 Jun 2022
  • 2 Minutes to read
  • Dark
    Light

Using the Recipe API

  • Dark
    Light

Article Summary

Enrich allows you to create a customized recipe by adding steps and the consume the recipe with an API.

These are the two types of steps you can add to an Enrich recipe:

  • Transformations: Adds this step to change the format, structure, or values of your data. You can do this by adding a filter, aggregate functions, replace null, or add a date to receive foot traffic data on and more.
  • Enrich data: Adds external data to your core data by adding interesting signals that can help in your decision-making process.

Each step you apply to your data will automatically be added to the project recipe. A recipe is a flow of steps that will run in sequence, according to the order of the flow. After you finish creating a recipe, you can apply it to new data via the API .  The data you run via the API will be processed step by step according to the recipe you created.

API Limits

The standard QPM (Queries Per Minute) is 200, if you have a need for a higher QPM please speak to your CSM.

To use the recipe API:

  1. Click EnrichThe Enrich page is displayed.
  2. Create, search or edit a project.
  3. Click Export and click Use API.
  4. Copy the API template, by clicking Copy API to clipboard

How to send an API request 

API template:

POST

url: <host>/api/signals/project/<project_id>/api

data: [{<item>}]


Headers:

  • Content-Type: application/json
  • API-KEY: <tenant_api_key>
  • Host(<host>) - Usually should be app.explorium.ai (unless you know otherwise)
  • Project ID(<project_id>) - Each project has a Project ID, Found in the URL:       (https://app.explorium.ai/signals/b0f2055d2ce244fca987dda0d13a6440/data)
  • API-KEY (<tenant_api_key>) - Every tenant has an API-KEY, to generate it please contact the customer success team.
  • Data (<item>) - in a JSON format, separated by commas.
 --header 'Content-Type: application/json' \
           [{'column name': 'row'}]
[{'company_name': 'Google'}]

     

Please make sure the item includes all columns that were part of the original dataset, even if not all of them include signals that can be enriched, or if some of them have are null.

Example

curl --location --request POST 'https://app.explorium.ai/api/signals/project/d588e43a73d2446c9b2103442dd70150/api' \

--header 'API_KEY: 5e858d80c890a4df3c40b0b8e5a2d6d9' \

--header 'Content-Type: application/json' \

--data-raw '[{

   "companyName": "google",

   "state": "NY",

   "zipcode": " ",

   "formattedAddress": "",

   "city": "NY"

}]'


NOTE: This is only relevant for the trial users.


After you finish creating a recipe, you can apply it to new data via the API in the Enrich module. The data you run via the API will be processed step by step according to the recipe you created.

API Limits

The standard QPM (Queries Per Minute) is 200, if you have a need for a higher QPM please speak to your CSM.

To use the recipe API:

  1. Within an Enrich project, click the Export button.
  2. Click Use  API.
  3. You can copy the API template in CURL or in Python, by clicking Copy API to clipboard. Alternatively you can click the Sandbox button, and fill in the relevant fields , and click RunNow.

Required  and optional columns

The required columns for the API request are determined by the content of the project Recipe. In the API Sandbox, it is possible to see which core columns are required.  Optional columns will be marked (optional)

API Response

The API response body includes two sections:   

a. Data. - list of result column values  , with unique ID representing each column

b. Schema - list of result column names ,with unique IDrepresenting  each column

The unique ID ensures the integrity of the API integration even if the column names change in some point in time.