The Searchspring Bulk Indexing API allows you to request a Searchspring bulk index of your feed. This process will download your feed, process it and index your updated product data into our search databases. There is also a status endpoint to get the status of your index.

🚧

Warning

Feeds configured with an indexing interval of "Never" will not run even if a Bulk Indexing API request is made to run the indexing as this setting completely disables indexing job scheduling. Also, if a request to the Bulk Indexing API is made while an index is in progress it will cause indexing to be paused. To prevent this please see the Bulk Indexing Workflow below.

Bulk Indexing Workflow

  1. Query the Status endpoint and view the API response. If status key is success and feeds.indexStatus is done move to the next step.
  2. Query the Bulk Indexing API endpoint.



Status Endpoint

URL

https://[siteId]:[secretKey]@index-api.searchspring.net/api/index/status

Request Method

This endpoint accepts only GET requests.

Protocol

In order to protect your authentication credentials, this request must be made over HTTPS.

Request Authentication

This endpoint uses standard HTTP authentication. The username is the Site ID of your account. The password is the secret key of your account. Should you need assistance getting these values, please submit a ticket to our Support team using this form.


Request Parameters

There are no request parameters for this request. It will determine your account information based on your authentication above.

Request Example

curl -v -XGET -u foobar:abc123def456ghi789 "https://index-api.searchspring.net/api/index/status"

Response Format

The response returned is a JSON-encoded object with the following attributes.

  • status: The status of the request to fetch the status of your index. This will either be success or error.
  • feeds: An array of objects representing the feeds associated with your account.
  • feeds.id: The ID Of the current feed object.
  • feeds.lastIndexed: The time your last index finished successfully.
  • feeds.nextIndexTime: The next scheduled time your index will run automatically. This is incremented by your index interval once your index finishes.
  • feeds.indexStatus: A textual description of the status of indexing. Possible values include:
    • running: The index is currently running.
    • waiting: The index is waiting to run in our queue.
    • done: The index is finished.
    • error: The last index did not finish due to an error.
    • regen_waiting: The index is waiting for an external feed regeneration to start.
    • regen_running: The external feed regeneration is running.
    • regen_done: The external feed regeneration is done.
    • regen_error: An error was encountered during the external feed regeneration.

Response Example

{
  "status": "success",
  "feeds": [{
      "id": 1143,
      "lastIndexed": "2017-05-30T13:50:25+0000",
      "nextIndexTime": "2017-05-30T16:03:42+0000",
      "indexStatus": "done"
  }]
}



Bulk Index Endpoint

URL

https://[siteId]:[secretKey]@index-api.searchspring.net/api/index/feed

Request Method

This endpoint accepts both PUT and POST requests.

The PUT version of this endpoint will download your product data from your cart or server and trigger an index of that data. This is endpoint should be used if you are using one of our cart integrations (Shopify, BigCommerce, etc).

The POST version of this endpoint accepts a feed file, uploads it to our server and triggers an index of that feed. You should only use this endpoint in the case that you are using a custom CSV or XML file.If you wish to use this endpoint, please submit a ticket to our Support team using this form so they can update your feed URL to point to the location where your feed will be uploaded on our servers.

Both of these versions will only accept a re-index once per hour.

Protocol

In order to protect your authentication credentials, this request must be made over HTTPS.

Content-Type

The request parameters require that the Content-Type header is sent as "multi-part/form-data" in order to send the feed file.

Request Authentication

This endpoint uses standard HTTP authentication. The username is the Site ID of your account. The password is the secret key of your account. Should you need assistance getting these values, please submit a ticket to our Support team using this form.


Request Parameters

Feed ID (Required): Identifies the feed to index.

FormatfeedId=[value]
ExamplefeedId=65

Feed File:The path of the feed file to upload. The maximum size of this file is 20MB. It is recommended that you compress your feed using zip or gzip compression to reduce file size. Only used in the POST version of this endpoint.

FormatfeedFile=@[filename.zip]
ExamplefeedFile=@/path/to/my/feed.zip

Requested By: The email address to send the status email once indexing completes.

FormatrequestedBy=[[email protected]]
ExamplerequestedBy=james%40searchspring.com

Post Request Example

curl -v -XPOST -u foobar:abc123def456ghi789 -F feedFile=@/path/to/feed_file.zip "https://index-api.searchspring.net/api/index/feed?feedId=42&requestedBy=myemail%40searchspring.com"

Put Request Example (request parameters must be in the query string for put requests)

curl -v -XPUT -u foobar:abc123def456ghi789 https://index-api.searchspring.net/api/index/feed?feedId=42

Response Format

The response returned is a JSON-encoded object with the following attributes:

  • success: Returns true if the feed was successfully added to the indexing queue or false if an error was encountered. A feed may still fail while indexing when success is returned, this endpoint merely returns whether or not the feed was added to the indexing queue successfully. To determine the success of the index you may use the status endpoint.

Response Example

{"success":true}