Tutorial | Add a dataset lookup endpoint to an API service (MLOps part 7)

The query enrichment tutorial demonstrated adding an enrichment to a prediction endpoint in an API service.

Dataiku, however, supports many other types of API endpoints, including a dataset lookup. In fact, this endpoint is essentially the enrichment step of a prediction query—but without passing the query to a prediction model.


In this tutorial, you will:

  • Create a dataset lookup endpoint in an API service.

Starting here?

This section requires having created the API service in Part 5, and so it’s required to complete that section in order to reproduce the steps here.

Add a dataset lookup endpoint

Suppose we want to send a query including a specific merchant_id to an endpoint in an API service and receive all information relating to this specific merchant from the database.

We can add an endpoint to the API service just for this purpose. The new endpoint will perform a dataset lookup in the merchant_info dataset, returning the other values in the dataset for a unique merchant_id.

  • From the API Designer page on the Design instance, open the fraud_detection API service.

  • Near the top left, click on the first endpoint to open the dropdown menu, and click Create new endpoint. If none exists yet, click to + Create Your First Endpoint.

  • Name the endpoint merchant_lookup.

  • Select Dataset(s) lookup as the Endpoint type.

  • Click Append.

    Dataiku screenshot of a dialog for appending a dataset lookup endpoint to an API service.

  • In the Lookups panel, click + Add Enrichment.

  • Select merchant_info as the dataset to use for enrichment.

  • Leave the default Bundled deployment policy.

  • Next to Lookup keys definition, click + Add Key, and select the merchant_id column. The Name in query for this feature will be the same, and so we don’t need to remap the name.

  • Click the check box next to Select all to retrieve all columns.

Dataiku screenshot of the configuration of a dataset lookup endpoint.

Test the dataset lookup endpoint

The dataset lookup endpoint is now included in the fraud_detection API service and ready for use. But first, let’s test the endpoint to confirm that it works properly.

  • Navigate to the Test queries panel of the merchant_lookup endpoint.

  • Click + Add Queries, and paste the following:

      "data": {"merchant_id" : "M_ID_000572bc62"}
  • Click Run Test Queries, and observe the retrieved values for all of the columns in the merchant_info dataset:

Dataiku screenshot of a test query on a dataset lookup endpoint.

Next steps

Congratulations! You added a dataset lookup endpoint to an API service.

Although we could manually redeploy a new version of this API service (as done in the previous tutorial), let’s next demonstrate how to automatically update an API deployment with a scenario.


See the reference documentation for more information about supported endpoints or the dataset lookup endpoint in particular.