Search API Client for Python
Algolia Python Client
  • Fully “pythonic”, follows modern Python while supporting Python 2
  • Version

    • Supports Python: 2.7, 3.4, 3.5, 3.6, 3.7, 3.8

    Related Integrations

    Key links


    Get started

    Install (get a free account here.)

    1npm install algoliasearch

    Index

    1const objects = [{
    2  firstname: 'Jimmie',
    3  lastname: 'Barninger',
    4  objectID: 'myID1'
    5}, {
    6  firstname: 'Warren',
    7  lastname: 'Speach',
    8  objectID: 'myID2'
    9}];
    10
    11index.saveObjects(objects).then(({ objectIDs }) => {
    12  console.log(objectIDs);
    13});

    Search

    1from algoliasearch.search_client import SearchClient
    23client = SearchClient.create("AppId", "AdminAPIKey")
    4index = client.init_index("index_name")
    56# index records
    7records = [
    8    {"objectID": "myID1", "firstname": "Jimmie", "lastname": "Barninger"},
    9    {"objectID": "myID2", "firstname": "Warren", "lastname": "Speach"},
    10]
    11index.save_objects(records).wait()
    1213# only query string
    14res = index.search('Jim')
    15print(res)
    1617# or with params
    18res = index.search('Jim', {
    19    'attributesToRetrieve': [ 'firstname', 'lastname' ],
    20    'hitsPerPage': 50
    21})
    22print(res)
    Get started for freeExplore all developer docs

    Built with Python on Algolia

    Showcase
    Sample Applications

    Image Search OCR - Delivery Scanner

    This app lets you scan a shipping label with your phone and sends a Slack message to the recipient of the package

    • javascript
    • go
    • python