This quickstart demonstrates various usages of the the Algolia Python API Client.
- An Algolia account. If you don't have one already, create an account for free.
- A Python >= 3.7 local environment, or Docker.
Using VSCode
By using VScode and having the Visual Studio Code Remote - Containers extension installed, you can run any of the quickstarts by using the command Remote-Containers: Open Folder in Container command.
Each of the quickstart contains a .devcontainer.json, along with a Dockerfile.
- Create an Algolia Application and an Algolia Index
- Copy the file .env.example and rename it to
.env - Set the environment variables
ALGOLIA_APP_ID,ALGOLIA_API_KEYandALGOLIA_INDEX_NAMEin the.envfile. You can obtain those from the Algolia Dashboard. TheALGOLIA_API_KEYshould be the "Admin API Key" (necessary for indexing).
Once setup, you can run each of the script in this folder using the Python command line.
Example: to execute the simple.py script:
python simple.py| File | Description |
|---|---|
| simple.py | Index a single object and run a search query |
| indexing.py | Showcase of the main indexing methods |
| generate_key.py | Generate a rate limited API key |
| backup.py | Backup an index and associated rules, synonyms and settings |
| restore.py | Restore an index from a local file |
| analytics.py | Retrieve top 1000 searches for an index |