1. Search experiences

Manage API crawler sources

Important

Feature availability is part of a phased rollout. Your organization may not see this functionality yet. It will become available when your environment is included in the rollout.

An API crawler is a type of source that retrieves records from the endpoint you provide and turns them into documents in a search index. You provide the API endpoint and define how SitecoreAI interprets the API response so it can identify the content to index. SitecoreAI then retrieves the data from the API, creates index documents from the returned records, and adds them to your search index.

You can create an API crawler using one of two workflows. Choose the one that matches how your API returns the records you want to index:

Create an API crawler

An API crawler crawls an endpoint you specify, and turns the response into items in your search index. When you configure an API crawler, you tell SitecoreAI how to translate the API response into usable fields.

To create an API crawler:

  1. On the menu bar, click Content > Search sources.

  2. On the Search Sources page, click Create Source > API crawler.

  3. In the Source Name field, enter a name for your source.

  4. Optionally, enter a description, then click Next step.

  5. Use the Locales drop-down list to select the locales that this source supports, then click Next step.

  6. In the Endpoint URL field, enter the API endpoint to query. Optionally, configure:

    • Query parameters to specify which records the API returns.
    • Headers required to access the API.
    • Authentication credentials if the endpoint requires authentication.
    • Language codes to send to the API if you want to override the selected locales.

    Then click Next step.

  7. In the Items location field, enter the path to the records in the response that you want to index. For example, $.data.items. Optionally, in the Response field, click Use as record to use SitecoreAI's suggested record path. Then click Next step.

  8. Select the pagination method that the API uses to return records:

    • All records in one response - the API returns all records without pagination.
    • Page number - the API uses a page number to identify each set of records.
    • Offset - the API uses an offset to identify where to start returning records.
    • Cursor token - the API uses a token to identify the next set of records.

    Then click Next step.

  9. Select whether the API response contains one of the following, then click Next step:

    • Records to index - the records you want to index. Continue to step 10 to map fields from these records.
    • A list to follow - records containing values that SitecoreAI uses to make another API request. Continue with Create a multi-step API crawler.
  10. Specify the Display Name, Field Name, Type, and JSONPath of the fields in your source and their behavior, then click Next step.

    Tip

    Click Browse to browse the JSON values SitecoreAI has suggested as fields.

  11. Enable the advanced settings you want to use, then click Save.

Reindex content for an API crawler source

Because the data an API returns can change, it's important to keep API crawler source indexes up to date with the latest information.

When you reindex an API crawler source, SitecoreAI rebuilds the underlying index and seamlessly switches the source to use the updated index. This ensures that search experiences connected to the source continue to return results while the reindexing process completes.

To reindex content for a source:

  1. On the menu bar, click Content > Search sources.
  2. Next to the source you want to reindex content for, click Reindex content.

View an API crawler source

Clicking a source allows you to view and edit that source's configurations, including fields and rules.

To view the details associated with an API crawler source:

  1. On the menu bar, click Content > Search sources.
  2. Click the API crawler source.
  3. Click any of the following tabs:
    • Fields - displays the list of fields indexed by the source, and their configurations.
    • Pinning Rules - displays a list of pinning rules active on the source. Click Add a pin to create a pin rule.
    • Boost/Bury Rules - displays a list of boost and bury rules active on the source. Click Add new rule to create a new boost or bury rule.
    • Settings - displays the source settings, such as the source name, ID, and advanced settings.
    • Preview - displays a preview of the content indexed in this source, and the number of fields that have been indexed for each item.

Delete an API crawler source

Important

When you delete a source, search components connected to that source don't return results. You can select a new source in the Source Configuration Manager menu.

To delete an API crawler source:

  1. On the menu bar, click Content > Search sources.
  2. Next to the source you want to delete, click Actions .
  3. Click Delete.
  4. To confirm the deletion, click Delete.

Configure a search component

After the source has indexed content, configure a search component to display results from the source.

If you have suggestions for improving this article, let us know!