Guides
/
Sending and managing data
/
Send and update your data
/
Connectors
May 14, 2024
JSON
The JSON connector lets you read objects from a JSON file and store them in an Algolia index.
The connector imports a single array of JSON objects as records. Each record must have a unique identifier to be used as the object ID in Algolia.
In the following example, userID
could serve as the object ID.
Copy
1
2
3
4
5
6
7
8
9
10
11
12
[
{
"userID": 1001,
"firstName": "Marianne",
"lastName": "Neal"
},
{
"userID": 1002,
"firstName": "Austin",
"lastName": "Wolfe"
}
]
Configure your data source
- Open the Connectors page in the Algolia dashboard.
- Select the JSON connector and click Connect.
- Click Get started.
- Select the authentication method:
- None if the file is public.
- Basic Auth if you need a username and password to access the file.
- Enter the FTP or HTTP URL to your JSON file. For HTTP URLs, you can further select whether to fetch the JSON file with a GET or a POST request. This depends on your server.
- In the Unique property identifier field, enter the property of your JSON objects that should serve as unique identifiers for your Algolia records (
objectID
). - Enter a name for the source. This helps you distinguish between different sources.
- Click Create source.
Configure your destination
- Create a new Algolia API key or select an existing one for indexing your data.
- Enter an index name, where the connector should store the records. If you enter a name of an existing index, it’ll be overwritten.
- Enter a name for the destination. This helps you distinguish between different destinations.
- Click Create destination.
Configure your task
- Select when the connector should fetch your data:
- On demand. The connector only fetches data if you manually run it from the Tasks.
- Scheduled. The connector runs on a schedule. You can select a schedule from the list, or enter a custom schedule with a cron expression.
- Click Create task.
Manage your task
To see the status of your tasks, run them, deactivate them, or delete them, go to the Tasks in the Algolia dashboard.
Did you find this page helpful?