Typesense

Typesense API

An open source search engine for building delightful search experiences.

Developer tools#openapi

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

An open source search engine for building delightful search experiences.

Endpoints 79

collections

  • GETList all collections/collectionsReturns a summary of all your collections. The collections are returned sorted by creation date, with the most recent collections appearing first.
  • POSTCreate a new collection/collectionsWhen a collection is created, we give it a name and describe the fields that will be indexed from the documents added to the collection.
  • GETRetrieve a single collection/collections/:collectionNameRetrieve the details of a collection, given its name.
  • DELETEDelete a collection/collections/:collectionNamePermanently drops a collection. This action cannot be undone. For large collections, this might have an impact on read latencies.
  • PATCHUpdate a collection/collections/:collectionNameUpdate a collection's schema to modify the fields and their types.
  • GETList all aliases/aliasesList all aliases and the corresponding collections that they map to.
  • GETRetrieve an alias/aliases/:aliasNameFind out which collection an alias points to by fetching it
  • PUTCreate or update a collection alias/aliases/:aliasNameCreate or update a collection alias. An alias is a virtual collection name that points to a real collection. If you're familiar with symbolic links on Linux,…
  • DELETEDelete an alias/aliases/:aliasName

documents

  • POSTIndex a document/collections/:collectionName/documentsA document to be indexed in a given collection must conform to the schema of the collection.
  • DELETEDelete a bunch of documents/collections/:collectionName/documentsDelete a bunch of documents that match a specific filter condition. Use the batch_size parameter to control the number of documents that should deleted at a…
  • PATCHUpdate documents with conditional query/collections/:collectionName/documentsThe filter_by query parameter is used to filter to specify a condition against which the documents are matched. The request body contains the fields that…
  • GETSearch for documents in a collection/collections/:collectionName/documents/search?searchParameters={"q":"string","query_by":"string","nl_query":true,"nl_model_id":"string","query_by_weights":"string","text_match_type":"string","prefix":"string","infix":"string","max_extra_prefix":0,"max_extra_suffix":0,"filter_by":"num_employees:>100 && country: [USA, UK]","max_filter_by_candidates":0,"sort_by":"num_employees:desc","facet_by":"string","max_facet_values":0,"facet_query":"string","num_typos":"string","page":0,"per_page":0,"limit":0,"offset":0,"group_by":"string","group_limit":0,"group_missing_values":true,"include_fields":"string","exclude_fields":"string","highlight_full_fields":"string","highlight_affix_num_tokens":0,"highlight_start_tag":"string","highlight_end_tag":"string","enable_highlight_v1":true,"enable_analytics":true,"snippet_threshold":0,"synonym_sets":"synonym_set_1,synonym_set_2","drop_tokens_threshold":0,"drop_tokens_mode":"right_to_left","typo_tokens_threshold":0,"enable_typos_for_alpha_numerical_tokens":true,"filter_curated_hits":true,"enable_synonyms":true,"synonym_prefix":true,"synonym_num_typos":0,"pinned_hits":"string","hidden_hits":"string","override_tags":"string","highlight_fields":"string","split_join_tokens":"string","pre_segmented_query":true,"preset":"string","enable_overrides":false,"prioritize_exact_match":true,"max_candidates":0,"prioritize_token_position":false,"prioritize_num_matching_fields":true,"enable_typos_for_numerical_tokens":true,"exhaustive_search":true,"search_cutoff_ms":0,"use_cache":true,"cache_ttl":0,"min_len_1typo":0,"min_len_2typo":0,"vector_query":"string","remote_embedding_timeout_ms":0,"remote_embedding_num_tries":0,"facet_strategy":"string","stopwords":"string","facet_return_parent":"string","voice_query":"string","conversation":true,"conversation_model_id":"string","conversation_id":"string"}Search for documents in a collection that match the search criteria.
  • GETExport all documents in a collection/collections/:collectionName/documents/exportExport all documents in a collection in JSON lines format.
  • POSTImport documents into a collection/collections/:collectionName/documents/importThe documents to be imported must be formatted in a newline delimited JSON structure. You can feed the output file from a Typesense export operation directly…
  • GETRetrieve a document/collections/:collectionName/documents/:documentIdFetch an individual document from a collection by using its ID.
  • DELETEDelete a document/collections/:collectionName/documents/:documentIdDelete an individual document from a collection by using its ID.
  • PATCHUpdate a document/collections/:collectionName/documents/:documentIdUpdate an individual document from a collection by using its ID. The update can be partial.
  • POSTsend multiple search requests in a single HTTP request/multi_search?multiSearchParameters={"q":"string","query_by":"string","query_by_weights":"string","text_match_type":"string","prefix":"string","infix":"string","max_extra_prefix":0,"max_extra_suffix":0,"filter_by":"num_employees:>100 && country: [USA, UK]","sort_by":"string","facet_by":"string","max_facet_values":0,"facet_query":"string","num_typos":"string","page":0,"per_page":0,"limit":0,"offset":0,"group_by":"string","group_limit":0,"group_missing_values":true,"include_fields":"string","exclude_fields":"string","highlight_full_fields":"string","highlight_affix_num_tokens":0,"highlight_start_tag":"string","highlight_end_tag":"string","snippet_threshold":0,"drop_tokens_threshold":0,"drop_tokens_mode":"right_to_left","typo_tokens_threshold":0,"enable_typos_for_alpha_numerical_tokens":true,"filter_curated_hits":true,"enable_synonyms":true,"enable_analytics":true,"synonym_prefix":true,"synonym_num_typos":0,"pinned_hits":"string","hidden_hits":"string","override_tags":"string","highlight_fields":"string","pre_segmented_query":false,"preset":"string","enable_overrides":false,"prioritize_exact_match":true,"prioritize_token_position":false,"prioritize_num_matching_fields":true,"enable_typos_for_numerical_tokens":true,"exhaustive_search":true,"search_cutoff_ms":0,"use_cache":true,"cache_ttl":0,"min_len_1typo":0,"min_len_2typo":0,"vector_query":"string","remote_embedding_timeout_ms":0,"remote_embedding_num_tries":0,"facet_strategy":"string","stopwords":"string","facet_return_parent":"string","voice_query":"string","conversation":true,"conversation_model_id":"string","conversation_id":"string"}This is especially useful to avoid round-trip network latencies incurred otherwise if each of these requests are sent in separate HTTP requests. You can also…

analytics

  • GETRetrieve analytics events/analytics/events?user_id=string&name=string&n=0Retrieve the most recent events for a user and rule.
  • POSTCreate an analytics event/analytics/eventsSubmit a single analytics event. The event must correspond to an existing analytics rule by name.
  • POSTFlush in-memory analytics to disk/analytics/flushTriggers a flush of analytics data to persistent storage.
  • GETGet analytics subsystem status/analytics/statusReturns sizes of internal analytics buffers and queues.
  • GETRetrieve analytics rules/analytics/rulesRetrieve all analytics rules. Use the optional rule_tag filter to narrow down results.
  • POSTCreate analytics rule(s)/analytics/rulesCreate one or more analytics rules. You can send a single rule object or an array of rule objects.
  • GETRetrieves an analytics rule/analytics/rules/:ruleNameRetrieve the details of an analytics rule, given it's name
  • PUTUpserts an analytics rule/analytics/rules/:ruleNameUpserts an analytics rule with the given name.
  • DELETEDelete an analytics rule/analytics/rules/:ruleNamePermanently deletes an analytics rule, given it's name

keys

  • GETRetrieve (metadata about) all keys./keys
  • POSTCreate an API Key/keysCreate an API Key with fine-grain access control. You can restrict access on both a per-collection and per-action level. The generated key is returned only…
  • GETRetrieve (metadata about) a key/keys/:keyIdRetrieve (metadata about) a key. Only the key prefix is returned when you retrieve a key. Due to security reasons, only the create endpoint returns the full…
  • DELETEDelete an API key given its ID./keys/:keyId

debug

  • GETPrint debugging information/debugPrint debugging information

operations

  • GETGet the status of in-progress schema change operations/operations/schema_changesReturns the status of any ongoing schema change operations. If no schema changes are in progress, returns an empty response.
  • POSTCreates a point-in-time snapshot of a Typesense node's state and data in the specified directory./operations/snapshot?snapshot_path=stringCreates a point-in-time snapshot of a Typesense node's state and data in the specified directory. You can then backup the snapshot directory that gets created…
  • POSTTriggers a follower node to initiate the raft voting process, which triggers leader re-election./operations/voteTriggers a follower node to initiate the raft voting process, which triggers leader re-election. The follower node that you run this operation against will…
  • POSTClear the cached responses of search requests in the LRU cache./operations/cache/clearClear the cached responses of search requests that are sent with use_cache parameter in the LRU cache.
  • POSTCompacting the on-disk database/operations/db/compactTypesense uses RocksDB to store your documents on the disk. If you do frequent writes or updates, you could benefit from running a compaction of the…
  • POSTToggle Slow Request Log/configEnable logging of requests that take over a defined threshold of time. Default is -1 which disables slow request logging. Slow requests are logged to the…
  • GETGet current RAM, CPU, Disk & Network usage metrics./metrics.jsonRetrieve the metrics.
  • GETGet stats about API endpoints./stats.jsonRetrieve the stats about API endpoints.

stopwords

  • GETRetrieves all stopwords sets./stopwordsRetrieve the details of all stopwords sets
  • GETRetrieves a stopwords set./stopwords/:setIdRetrieve the details of a stopwords set, given it's name.
  • PUTUpserts a stopwords set./stopwords/:setIdWhen an analytics rule is created, we give it a name and describe the type, the source collections and the destination collection.
  • DELETEDelete a stopwords set./stopwords/:setIdPermanently deletes a stopwords set, given it's name.

presets

  • GETRetrieves all presets./presetsRetrieve the details of all presets
  • GETRetrieves a preset./presets/:presetIdRetrieve the details of a preset, given it's name.
  • PUTUpserts a preset./presets/:presetIdCreate or update an existing preset.
  • DELETEDelete a preset./presets/:presetIdPermanently deletes a preset, given it's name.

conversations

  • GETList all conversation models/conversations/modelsRetrieve all conversation models
  • POSTCreate a conversation model/conversations/modelsCreate a Conversation Model
  • GETRetrieve a conversation model/conversations/models/:modelIdRetrieve a conversation model
  • PUTUpdate a conversation model/conversations/models/:modelIdUpdate a conversation model
  • DELETEDelete a conversation model/conversations/models/:modelIdDelete a conversation model

synonyms

  • GETList all synonym sets/synonym_setsRetrieve all synonym sets
  • GETRetrieve a synonym set/synonym_sets/:synonymSetNameRetrieve a specific synonym set by its name
  • PUTCreate or update a synonym set/synonym_sets/:synonymSetNameCreate or update a synonym set with the given name
  • DELETEDelete a synonym set/synonym_sets/:synonymSetNameDelete a specific synonym set by its name
  • GETList items in a synonym set/synonym_sets/:synonymSetName/itemsRetrieve all synonym items in a set
  • GETRetrieve a synonym set item/synonym_sets/:synonymSetName/items/:itemIdRetrieve a specific synonym item by its id
  • PUTCreate or update a synonym set item/synonym_sets/:synonymSetName/items/:itemIdCreate or update a synonym set item with the given id
  • DELETEDelete a synonym set item/synonym_sets/:synonymSetName/items/:itemIdDelete a specific synonym item by its id

curation_sets

  • GETList all curation sets/curation_setsRetrieve all curation sets
  • GETRetrieve a curation set/curation_sets/:curationSetNameRetrieve a specific curation set by its name
  • PUTCreate or update a curation set/curation_sets/:curationSetNameCreate or update a curation set with the given name
  • DELETEDelete a curation set/curation_sets/:curationSetNameDelete a specific curation set by its name
  • GETList items in a curation set/curation_sets/:curationSetName/itemsRetrieve all curation items in a set
  • GETRetrieve a curation set item/curation_sets/:curationSetName/items/:itemIdRetrieve a specific curation item by its id
  • PUTCreate or update a curation set item/curation_sets/:curationSetName/items/:itemIdCreate or update a curation set item with the given id
  • DELETEDelete a curation set item/curation_sets/:curationSetName/items/:itemIdDelete a specific curation item by its id

stemming

  • GETList all stemming dictionaries/stemming/dictionariesRetrieve a list of all available stemming dictionaries.
  • GETRetrieve a stemming dictionary/stemming/dictionaries/:dictionaryIdFetch details of a specific stemming dictionary.
  • POSTImport a stemming dictionary/stemming/dictionaries/import?id=irregular-pluralsUpload a JSONL file containing word mappings to create or update a stemming dictionary.

nl_search_models

  • GETList all NL search models/nl_search_modelsRetrieve all NL search models.
  • POSTCreate a NL search model/nl_search_modelsCreate a new NL search model.
  • GETRetrieve a NL search model/nl_search_models/:modelIdRetrieve a specific NL search model by its ID.
  • PUTUpdate a NL search model/nl_search_models/:modelIdUpdate an existing NL search model.
  • DELETEDelete a NL search model/nl_search_models/:modelIdDelete a specific NL search model by its ID.

health

  • GETChecks if Typesense server is ready to accept requests./healthChecks if Typesense server is ready to accept requests.

API details

Authentication
An API key in the X-TYPESENSE-API-KEY header
Operations
79 operations on 46 pathsGET 36POST 16DELETE 14PUT 10PATCH 3
Main resources
documents 10analytics 9collections 9curation_sets 8operations 8synonyms 8conversations 5nl_search_models 5keys 4presets 4
Response formats
application/json application/octet-stream
Description format
OpenAPI 3.0.3, API version 30.0

How to test the Typesense API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Typesense API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses an API key in the X-TYPESENSE-API-KEY header. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “List all collections” (GET /collections), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Typesense API?

An open source search engine for building delightful search experiences. It is listed under Developer tools and has 79 endpoints.

Who publishes the Typesense API?

It is listed from Typesense's public API description (an OpenAPI document), not published by Typesense on Swastik Codes. Anyone who controls typesense.org can claim the profile by adding a DNS TXT record.

How do I authenticate with the Typesense API?

With an API key in the X-TYPESENSE-API-KEY header.

How many endpoints does the Typesense API have?

79 operations on 46 paths (36 GET, 16 POST, 14 DELETE, 10 PUT, 3 PATCH). The largest groups are documents, analytics, collections, curation_sets.

Is forking the Typesense API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.