首页 > 解决方案 > Push Data with API REST in Algolia

问题描述

I'm learning to use angolia, but I have a question about it. Is it possible to push data to an index with API REST?

I have only seen to use API CLIENT, installed for Javascript with npm, but I don't want to install it.

what I want it's something like that:

    curl -X POST 'https://places-dsn.algolia.net/1/places/query' \
  -H 'X-Algolia-Application-Id: YourApplicationId' \
  -H 'X-Algolia-API-Key: YourAPIKey' \
  --data '{"query": "Paris"}

标签: javascriptapirestalgolia

解决方案


There is a RESTful API available, but there is no SLA when using it directly.

Here's an example:

curl -X POST \
     -H "X-Algolia-API-Key: ${API_KEY}" \
     -H "X-Algolia-Application-Id: ${APPLICATION_ID}" \
     --data-binary '{ "params": "query=Paris" }' \
     "https://${APPLICATION_ID}-dsn.algolia.net/1/indexes/${INDEX_NAME}/query"

View the API documentation.


推荐阅读