# 🥥 ORKG-Ask API Overview Version: 1.17.2 ## Accessing the API Interactive API documentation is available at `None`. ## Authentication All GET requests are public. Other methods may require authentication. ## API Endpoints ### **GET** `/openapi.json` **Example:** ```bash curl -X GET '/openapi.json' ``` --- ### **GET** `/docs` **Example:** ```bash curl -X GET '/docs' ``` --- ### **GET** `/llm/extract/item/values` Extracts the properties with their corresponding values from the given item. **Query Parameters:** - `properties` (list[str]): The properties to extract from the item (default: No default) - `item_id` (Union[int, str, NoneType]): The item ID to extract the values from - `collection_item_id` (Union[str, NoneType]): The custom collection item ID to extract the values from - `invalidate_cache` (bool): Whether to invalidate the cache for the item (default: False) - `response_language` (UnionType[str, NoneType]): The language of the response. Should be one of the following: en, de, es, fr, it, pt, nl, ru, ja, ar, fa, tr, ko, zh, hi, vi, id - `seed` (UnionType[int, NoneType]): The seed to use during extraction - `reproducibility` (bool): Whether to include the generation parameters and prompts for the response (default: False) **Response:** Returns: `ExtractItemValuesFromPropertiesResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (Payload) (default: No default) - `item_id` (UnionType[int, str]): The ID of the item to extract properties from (default: No default) - `properties` (list[str]): The properties to extract from the item (default: No default) - `values` (dict[str, Union[str, list[UnionType[str, int, float]], int, float]]): The extracted values for the properties (default: No default) - `extra` (dict[str, Union[str, list[UnionType[str, int, float]], int, float]]): Extra values detected by the LLM (default: No default) - `seed` (UnionType[int, NoneType]): The seed used during extraction (if any) - `reproducibility` (Union[KVPReproducibility, NoneType]): The reproducibility parameters for the extraction **Example:** ```bash curl -X GET '/llm/extract/item/values?properties=example_properties&item_id=doc_123' ``` --- ### **GET** `/llm/synthesize/items/abstracts` Synthesizes a citable answer for a given research question from the abstracts of the given items. **Query Parameters:** - `question` (str): The question to synthesize the abstracts for (default: No default) - `item_ids` (list[UnionType[int, str]]): The item ID to use during synthesis - `collection_item_ids` (list[UnionType[int, str]]): The custom collection item IDs to use during synthesis - `invalidate_cache` (bool): Whether to invalidate the cache for the item (default: False) - `response_language` (UnionType[str, NoneType]): The language of the response. Should be one of the following: en, de, es, fr, it, pt, nl, ru, ja, ar, fa, tr, ko, zh, hi, vi, id - `seed` (UnionType[int, NoneType]): The seed to use during extraction - `reproducibility` (bool): Whether to include the generation parameters and prompts for the response (default: False) **Response:** Returns: `SynthesisAnswerOfQuestionFromAbstractsResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (Payload) (default: No default) - `items_mapping` (dict[int, UnionType[str, int]]): The item IDs mappings to the citations (default: No default) - `collection_items_mapping` (dict[int, UnionType[str, int]]): The collection item IDs mappings to the citations (default: No default) - `question` (str): The question to synthesize the answer for (default: No default) - `synthesis` (str): The synthesized answer for the question (default: No default) - `seed` (UnionType[int, NoneType]): The seed used during synthesis (if any) - `reproducibility` (Union[SynReproducibility, NoneType]): The reproducibility parameters for the synthesis **Example:** ```bash curl -X GET '/llm/synthesize/items/abstracts?question=example_question&item_ids=doc_123' ``` --- ### **POST** `/llm/generate` **Body Parameters:** - `request` (LLMGenerateRequest) (default: No default) - `prompt` (str): The prompt to generate the response for (default: No default) - `system` (UnionType[str, NoneType]): The system to use for generation. None by default. - `model` (UnionType[str, NoneType]): The model to use for generation. If not provided, the default model will be used - `stream` (bool): Whether to stream the output or not (default: True) (default: True) - `temperature` (float): The temperature to use for generation. Default is 0.5. (default: 0.5) - `top_k` (int): The number of tokens to consider for the top-k sampling (default: 10) - `top_n` (int): The number of tokens to consider for the top-n sampling (default: 5) - `top_p` (float): The nucleus sampling (default: 0.95) - `truncate` (UnionType[int, NoneType]): The maximum number of tokens to truncate. Default is 150. (default: 150) - `context_size` (UnionType[int, NoneType]): The context size to use for generation - `context` (Union[list[int], NoneType]): The context for the short-term memory - `seed` (UnionType[int, NoneType]): The seed to use for generation **Response:** Returns: `LLMRawResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (dict[]) (default: No default) **Example:** ```bash curl -X POST '/llm/generate' \ -H 'Content-Type: application/json' \ -d '{ "prompt": "example_prompt", "system": "example_system", "model": "llama3.1", "stream": true, "temperature": 0.7, "top_k": 50, "top_n": 42, "top_p": 0.9, "truncate": "example_truncate", "context_size": "Sample text content", "context": "Sample text content", "seed": 42 }' ``` --- ### **POST** `/llm/chat/completions` **Body Parameters:** - `request` (LLMChatRequest) (default: No default) - `model` (UnionType[str, NoneType]): The model to use for generation. If not provided, the default model will be used - `stream` (bool): Whether to stream the output or not (default: True) (default: True) - `messages` (list[LLMChatMessage]): The messages to generate the response for (default: No default) - `role` (Literal[user, assistant, system]): The role of the message (default: No default) - `content` (str): The content of the message (default: No default) - `temperature` (float): The temperature to use for generation. Default is 0.5. (default: 0.5) - `top_p` (float): The nucleus sampling (default: 0.95) - `truncate` (int): The maximum number of tokens to truncate (default: 150) - `stop` (UnionType[str, NoneType]): The stop token to use for generation - `seed` (UnionType[int, NoneType]): The seed to use for generation - `frequency_penalty` (float): The frequency penalty (default: 1) - `presence_penalty` (float): The presence penalty (default: 0.1) **Response:** Returns: `LLMRawResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (dict[]) (default: No default) **Example:** ```bash curl -X POST '/llm/chat/completions' \ -H 'Content-Type: application/json' \ -d '{ "model": "llama3.1", "stream": true, "messages": { "role": "example_role", "content": "This is sample content." }, "temperature": 0.7, "top_p": 0.9, "truncate": 42, "stop": "example_stop", "seed": 42, "frequency_penalty": 0.5, "presence_penalty": 0.5 }' ``` --- ### **POST** `/index/add` Index a new document in the vector database. **Body Parameters:** - `request` (IndexRequest) (default: No default) - `id` (UnionType[str, int]): The document ID, here is the coreID (default: No default) - `doi` (UnionType[str, NoneType]): The DOI of the document - `oai` (UnionType[str, NoneType]): The OAI of the document - `title` (str): The title of the document (default: No default) - `date_published` (UnionType[str, NoneType]): The date published of the document - `abstract` (UnionType[str, NoneType]): The abstract of the document - `year` (UnionType[int, str, NoneType]): The year of the document - `issn` (UnionType[str, NoneType]): The ISSN of the document - `full_text` (UnionType[str, NoneType]): The full text of the document - `subjects` (Union[list[str], NoneType]): A list of subjects of the document - `urls` (Union[list[str], NoneType]): A list of URLs of the document - `identifiers` (Union[list[str], NoneType]): A list of identifiers of the document - `topics` (Union[list[str], NoneType]): A list of topics of the document - `download_url` (UnionType[str, NoneType]): The download URL of the document - `full_text_identifier` (UnionType[str, NoneType]): The full text identifier of the document - `pdf_hash_value` (UnionType[str, NoneType]): The PDF hash value of the document - `raw_record_xml` (UnionType[str, NoneType]): The raw record XML of the document - `journals` (Union[list[str], NoneType]): A list of journals of the document - `authors` (Union[list[str], NoneType]): A list of authors of the document - `publisher` (UnionType[str, NoneType]): The publisher of the document - `relations` (Union[list[str], NoneType]): A list of relations of the document - `contributors` (Union[list[str], NoneType]): A list of contributors of the document - `language` (UnionType[str, NoneType]): The language of the document - `citation_count` (UnionType[int, NoneType]): The citation count of the document - `document_type` (UnionType[str, NoneType]): The inferred document type - `extractions` (UnionType[Extractions, NoneType]): The automatic extractions from the item - `source` (UnionType[str, NoneType]): The source of the document **Response:** Returns: `QdrantDictResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (dict[]): The payload of the response (default: No default) **Example:** ```bash curl -X POST '/index/add' \ -H 'Content-Type: application/json' \ -d '{ "id": "doc_123", "doi": "example_doi", "oai": "example_oai", "title": "Example Title", "date_published": "example_date_published", "abstract": "example_abstract", "year": "example_year", "issn": "example_issn", "full_text": "Sample text content", "subjects": "example_subjects", "urls": "example_urls", "identifiers": "doc_123", "topics": "example_topics", "download_url": "example_download_url", "full_text_identifier": "doc_123", "pdf_hash_value": "example_pdf_hash_value", "raw_record_xml": "example_raw_record_xml", "journals": "example_journals", "authors": "example_authors", "publisher": "example_publisher", "relations": "example_relations", "contributors": "example_contributors", "language": "example_language", "citation_count": "example_citation_count", "document_type": "example_document_type", "extractions": "example_extractions", "source": "example_source" }' ``` --- ### **POST** `/index/add/bulk` Index a list of documents in the vector database. **Body Parameters:** - `request` (BulkIndexRequest) (default: No default) - `documents` (list[IndexRequest]): The documents to be indexed (default: No default) - `id` (UnionType[str, int]): The document ID, here is the coreID (default: No default) - `doi` (UnionType[str, NoneType]): The DOI of the document - `oai` (UnionType[str, NoneType]): The OAI of the document - `title` (str): The title of the document (default: No default) - `date_published` (UnionType[str, NoneType]): The date published of the document - `abstract` (UnionType[str, NoneType]): The abstract of the document - `year` (UnionType[int, str, NoneType]): The year of the document - `issn` (UnionType[str, NoneType]): The ISSN of the document - `full_text` (UnionType[str, NoneType]): The full text of the document - `subjects` (Union[list[str], NoneType]): A list of subjects of the document - `urls` (Union[list[str], NoneType]): A list of URLs of the document - `identifiers` (Union[list[str], NoneType]): A list of identifiers of the document - `topics` (Union[list[str], NoneType]): A list of topics of the document - `download_url` (UnionType[str, NoneType]): The download URL of the document - `full_text_identifier` (UnionType[str, NoneType]): The full text identifier of the document - `pdf_hash_value` (UnionType[str, NoneType]): The PDF hash value of the document - `raw_record_xml` (UnionType[str, NoneType]): The raw record XML of the document - `journals` (Union[list[str], NoneType]): A list of journals of the document - `authors` (Union[list[str], NoneType]): A list of authors of the document - `publisher` (UnionType[str, NoneType]): The publisher of the document - `relations` (Union[list[str], NoneType]): A list of relations of the document - `contributors` (Union[list[str], NoneType]): A list of contributors of the document - `language` (UnionType[str, NoneType]): The language of the document - `citation_count` (UnionType[int, NoneType]): The citation count of the document - `document_type` (UnionType[str, NoneType]): The inferred document type - `extractions` (UnionType[Extractions, NoneType]): The automatic extractions from the item - `source` (UnionType[str, NoneType]): The source of the document **Example:** ```bash curl -X POST '/index/add/bulk' \ -H 'Content-Type: application/json' \ -d '{ "documents": { "id": "doc_123", "doi": "example_doi", "oai": "example_oai", "title": "Example Title", "date_published": "example_date_published", "abstract": "example_abstract", "year": "example_year", "issn": "example_issn", "full_text": "Sample text content", "subjects": "example_subjects", "urls": "example_urls", "identifiers": "doc_123", "topics": "example_topics", "download_url": "example_download_url", "full_text_identifier": "doc_123", "pdf_hash_value": "example_pdf_hash_value", "raw_record_xml": "example_raw_record_xml", "journals": "example_journals", "authors": "example_authors", "publisher": "example_publisher", "relations": "example_relations", "contributors": "example_contributors", "language": "example_language", "citation_count": "example_citation_count", "document_type": "example_document_type", "extractions": "example_extractions", "source": "example_source" } }' ``` --- ### **GET** `/index/search` Searches for similar documents using semantic vector search. Scholarly documents are indexed with metadata and embeddings, allowing for efficient retrieval. **Query Parameters:** - `query` (str): The text to search for (default: No default) - `limit` (int): The maximum number of documents to return (default: 10) - `offset` (UnionType[int, NoneType]): The offset to start fetching documents from - `filter` (UnionType[str, NoneType]): The criteria to filter the search results - `focus` (UnionType[list[str], NoneType]): The sources to search from - `fields` (UnionType[str, NoneType]): Which fields to return in the response, comma-separated. null for all fields **Response:** Returns: `QdrantPagedDocumentsResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (QdrantPageResponse): The page of documents that match the search (default: No default) - `items` (list[QdrantDocument]): The list of items retrieved from Qdrant (default: No default) - `id` (UnionType[str, int]): The document ID, here is the coreID (default: No default) - `doi` (UnionType[str, NoneType]): The DOI of the document - `oai` (UnionType[str, NoneType]): The OAI of the document - `title` (str): The title of the document (default: No default) - `date_published` (UnionType[str, NoneType]): The date published of the document - `abstract` (UnionType[str, NoneType]): The abstract of the document - `year` (UnionType[int, str, NoneType]): The year of the document - `issn` (UnionType[str, NoneType]): The ISSN of the document - `full_text` (UnionType[str, NoneType]): The full text of the document - `subjects` (Union[list[str], NoneType]): A list of subjects of the document - `urls` (Union[list[str], NoneType]): A list of URLs of the document - `identifiers` (Union[list[str], NoneType]): A list of identifiers of the document - `topics` (Union[list[str], NoneType]): A list of topics of the document - `download_url` (UnionType[str, NoneType]): The download URL of the document - `full_text_identifier` (UnionType[str, NoneType]): The full text identifier of the document - `pdf_hash_value` (UnionType[str, NoneType]): The PDF hash value of the document - `raw_record_xml` (UnionType[str, NoneType]): The raw record XML of the document - `journals` (Union[list[str], NoneType]): A list of journals of the document - `authors` (Union[list[str], NoneType]): A list of authors of the document - `publisher` (UnionType[str, NoneType]): The publisher of the document - `relations` (Union[list[str], NoneType]): A list of relations of the document - `contributors` (Union[list[str], NoneType]): A list of contributors of the document - `language` (UnionType[str, NoneType]): The language of the document - `citation_count` (UnionType[int, NoneType]): The citation count of the document - `document_type` (UnionType[str, NoneType]): The inferred document type - `extractions` (UnionType[Extractions, NoneType]): The automatic extractions from the item - `source` (UnionType[str, NoneType]): The source of the document - `total_hits` (int): The total number of documents that can be retrieved from Qdrant (default: No default) - `has_more` (bool): Whether there are more documents to be retrieved from Qdrant (default: No default) - `offset` (UnionType[int, str, UUID, NoneType]): The offset to start fetching documents from, could be int, str, or UUID **Example:** ```bash curl -X GET '/index/search?query=sample search query&limit=42' ``` --- ### **GET** `/index/get/{document_id}` Get a single document from the vector store via its ID **Path Parameters:** - `document_id` (str) (default: No default) **Query Parameters:** - `fields` (UnionType[str, NoneType]): Which fields to return in the response, comma-separated. null for all fields **Response:** Returns: `QdrantSingleDocumentResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (QdrantDocument): The item that matches the selection criteria (default: No default) - `id` (UnionType[str, int]): The document ID, here is the coreID (default: No default) - `doi` (UnionType[str, NoneType]): The DOI of the document - `oai` (UnionType[str, NoneType]): The OAI of the document - `title` (str): The title of the document (default: No default) - `date_published` (UnionType[str, NoneType]): The date published of the document - `abstract` (UnionType[str, NoneType]): The abstract of the document - `year` (UnionType[int, str, NoneType]): The year of the document - `issn` (UnionType[str, NoneType]): The ISSN of the document - `full_text` (UnionType[str, NoneType]): The full text of the document - `subjects` (Union[list[str], NoneType]): A list of subjects of the document - `urls` (Union[list[str], NoneType]): A list of URLs of the document - `identifiers` (Union[list[str], NoneType]): A list of identifiers of the document - `topics` (Union[list[str], NoneType]): A list of topics of the document - `download_url` (UnionType[str, NoneType]): The download URL of the document - `full_text_identifier` (UnionType[str, NoneType]): The full text identifier of the document - `pdf_hash_value` (UnionType[str, NoneType]): The PDF hash value of the document - `raw_record_xml` (UnionType[str, NoneType]): The raw record XML of the document - `journals` (Union[list[str], NoneType]): A list of journals of the document - `authors` (Union[list[str], NoneType]): A list of authors of the document - `publisher` (UnionType[str, NoneType]): The publisher of the document - `relations` (Union[list[str], NoneType]): A list of relations of the document - `contributors` (Union[list[str], NoneType]): A list of contributors of the document - `language` (UnionType[str, NoneType]): The language of the document - `citation_count` (UnionType[int, NoneType]): The citation count of the document - `document_type` (UnionType[str, NoneType]): The inferred document type - `extractions` (UnionType[Extractions, NoneType]): The automatic extractions from the item - `source` (UnionType[str, NoneType]): The source of the document **Example:** ```bash curl -X GET '/index/get/{document_id}?fields=example_fields' ``` --- ### **GET** `/index/explore` Explore documents from the vector store using filters. The filters only address the metadata like year, authors, etc.. **Query Parameters:** - `filter` (str): The criteria to filter the search results (default: No default) - `limit` (int): The maximum number of documents to return (default: 10) - `offset` (UnionType[UUID, NoneType]): The offset to start fetching documents from - `order_by` (UnionType[str, NoneType]): The payload field to order by - `focus` (UnionType[list[str], NoneType]): The sources to explore documents from - `fields` (UnionType[str, NoneType]): Which fields to return in the response, comma-separated. null for all fields **Response:** Returns: `QdrantPagedDocumentsResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (QdrantPageResponse): The page of documents that match the search (default: No default) - `items` (list[QdrantDocument]): The list of items retrieved from Qdrant (default: No default) - `id` (UnionType[str, int]): The document ID, here is the coreID (default: No default) - `doi` (UnionType[str, NoneType]): The DOI of the document - `oai` (UnionType[str, NoneType]): The OAI of the document - `title` (str): The title of the document (default: No default) - `date_published` (UnionType[str, NoneType]): The date published of the document - `abstract` (UnionType[str, NoneType]): The abstract of the document - `year` (UnionType[int, str, NoneType]): The year of the document - `issn` (UnionType[str, NoneType]): The ISSN of the document - `full_text` (UnionType[str, NoneType]): The full text of the document - `subjects` (Union[list[str], NoneType]): A list of subjects of the document - `urls` (Union[list[str], NoneType]): A list of URLs of the document - `identifiers` (Union[list[str], NoneType]): A list of identifiers of the document - `topics` (Union[list[str], NoneType]): A list of topics of the document - `download_url` (UnionType[str, NoneType]): The download URL of the document - `full_text_identifier` (UnionType[str, NoneType]): The full text identifier of the document - `pdf_hash_value` (UnionType[str, NoneType]): The PDF hash value of the document - `raw_record_xml` (UnionType[str, NoneType]): The raw record XML of the document - `journals` (Union[list[str], NoneType]): A list of journals of the document - `authors` (Union[list[str], NoneType]): A list of authors of the document - `publisher` (UnionType[str, NoneType]): The publisher of the document - `relations` (Union[list[str], NoneType]): A list of relations of the document - `contributors` (Union[list[str], NoneType]): A list of contributors of the document - `language` (UnionType[str, NoneType]): The language of the document - `citation_count` (UnionType[int, NoneType]): The citation count of the document - `document_type` (UnionType[str, NoneType]): The inferred document type - `extractions` (UnionType[Extractions, NoneType]): The automatic extractions from the item - `source` (UnionType[str, NoneType]): The source of the document - `total_hits` (int): The total number of documents that can be retrieved from Qdrant (default: No default) - `has_more` (bool): Whether there are more documents to be retrieved from Qdrant (default: No default) - `offset` (UnionType[int, str, UUID, NoneType]): The offset to start fetching documents from, could be int, str, or UUID **Example:** ```bash curl -X GET '/index/explore?filter=example_filter&limit=42' ``` --- ### **GET** `/index/recommend` Recommend documents from the vector store based on a list of document IDs. Other metadata filters can be applied to the search. **Query Parameters:** - `document_ids` (list[str]): The document IDs to be used for recommendations (default: No default) - `avoid_ids` (Union[list[str], NoneType]): The document IDs to be avoided for recommendations - `limit` (int): The maximum number of documents to return (default: 10) - `offset` (UnionType[int, NoneType]): The offset to start fetching documents from - `filter` (UnionType[str, NoneType]): The criteria to filter the search results - `fields` (UnionType[str, NoneType]): Which fields to return in the response, comma-separated. null for all fields **Response:** Returns: `QdrantListDocumentsResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (list[QdrantDocument]): The list of documents that match the search (default: No default) - `id` (UnionType[str, int]): The document ID, here is the coreID (default: No default) - `doi` (UnionType[str, NoneType]): The DOI of the document - `oai` (UnionType[str, NoneType]): The OAI of the document - `title` (str): The title of the document (default: No default) - `date_published` (UnionType[str, NoneType]): The date published of the document - `abstract` (UnionType[str, NoneType]): The abstract of the document - `year` (UnionType[int, str, NoneType]): The year of the document - `issn` (UnionType[str, NoneType]): The ISSN of the document - `full_text` (UnionType[str, NoneType]): The full text of the document - `subjects` (Union[list[str], NoneType]): A list of subjects of the document - `urls` (Union[list[str], NoneType]): A list of URLs of the document - `identifiers` (Union[list[str], NoneType]): A list of identifiers of the document - `topics` (Union[list[str], NoneType]): A list of topics of the document - `download_url` (UnionType[str, NoneType]): The download URL of the document - `full_text_identifier` (UnionType[str, NoneType]): The full text identifier of the document - `pdf_hash_value` (UnionType[str, NoneType]): The PDF hash value of the document - `raw_record_xml` (UnionType[str, NoneType]): The raw record XML of the document - `journals` (Union[list[str], NoneType]): A list of journals of the document - `authors` (Union[list[str], NoneType]): A list of authors of the document - `publisher` (UnionType[str, NoneType]): The publisher of the document - `relations` (Union[list[str], NoneType]): A list of relations of the document - `contributors` (Union[list[str], NoneType]): A list of contributors of the document - `language` (UnionType[str, NoneType]): The language of the document - `citation_count` (UnionType[int, NoneType]): The citation count of the document - `document_type` (UnionType[str, NoneType]): The inferred document type - `extractions` (UnionType[Extractions, NoneType]): The automatic extractions from the item - `source` (UnionType[str, NoneType]): The source of the document **Example:** ```bash curl -X GET '/index/recommend?document_ids=doc_123&avoid_ids=doc_123' ``` --- ### **GET** `/index/count` Count documents from the vector store using regular filters **Query Parameters:** - `filter` (UnionType[str, NoneType]): The criteria to filter the search results **Response:** Returns: `QdrantDictResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (dict[]): The payload of the response (default: No default) **Example:** ```bash curl -X GET '/index/count?filter=example_filter' ``` --- ### **GET** `/index/info` Get information about the available indices. **Response:** Returns: `QdrantDictResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (dict[]): The payload of the response (default: No default) **Example:** ```bash curl -X GET '/index/info' ``` --- ### **GET** `/backend/stats` Get the statistics of the dataset. **Response:** Returns: `StatisticsResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (Payload) (default: No default) - `indexing` (IndexingStats) (default: No default) - `num_indexed_vectors` (int): The number of indexed vectors in the vector store (default: No default) - `vector_config` (VectorConfig): The configuration of the vectors in the vector store (default: No default) - `vector_size` (int): The size of the vectors in the vector store (default: No default) - `distance_method` (str): The method used to calculate the distance between vectors (default: No default) - `dataset` (DatasetStats) (default: No default) - `num_items_with_authors` (UnionType[int, NoneType]): The number of items with authors - `num_items_with_abstracts` (UnionType[int, NoneType]): The number of items with abstracts - `num_items_with_languages` (UnionType[int, NoneType]): The number of items with language tags - `num_items_with_topics` (UnionType[int, NoneType]): The number of items with topics - `num_items_with_subjects` (UnionType[int, NoneType]): The number of items with subjects - `num_items_with_year` (UnionType[int, NoneType]): The number of items with year values - `num_items_with_identifiers` (UnionType[int, NoneType]): The number of items with identifiers - `num_items_with_type` (UnionType[int, NoneType]): The number of items with a specific document type - `num_items_with_issn` (UnionType[int, NoneType]): The number of items with an ISSN - `num_items_with_doi` (UnionType[int, NoneType]): The number of items with a DOI - `num_items_with_citations` (UnionType[int, NoneType]): The number of items with citation counts - `num_items_with_publication_date` (UnionType[int, NoneType]): The number of items with publication dates - `num_items_with_publisher` (UnionType[int, NoneType]): The number of items with publishers - `num_items_with_journal` (UnionType[int, NoneType]): The number of items with journal names - `num_items_with_dbpedia_entities` (UnionType[int, NoneType]): The number of items with DBpedia entities - `usage` (UsageStats) (default: No default) - `num_registered_users` (int): The number of registered users in the system (default: No default) - `num_cache_hits` (int): The number of cache hits in the system (default: No default) - `num_collections` (int): The number of user-created collections in the system (default: No default) - `num_collection_items` (int): The number of items in bibtex imported items to the system (default: No default) - `num_saved_searches` (int): The number of saved searches in the system (default: No default) - `num_shared_links` (int): The number of shared links in the system (default: No default) - `num_questions_asked` (int): Approximate number of non-unique questions asked to the system (default: No default) **Example:** ```bash curl -X GET '/backend/stats' ``` --- ### **GET** `/backend/questions/recent` Get the recent questions. **Query Parameters:** - `count` (int): the number of recent questions to return (default: 5) **Response:** Returns: `QuestionsResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (Payload) (default: No default) - `questions` (list[QuestionRecord]) (default: No default) - `question` (str): The question (default: No default) - `frequency` (int): The frequency of the question (default: 1) - `nsfw` (bool): Whether the question is NSFW (default: False) **Example:** ```bash curl -X GET '/backend/questions/recent?count=42' ``` --- ### **GET** `/backend/questions/popular` Get the recent questions. **Query Parameters:** - `count` (int): the number of popular questions to return (default: 5) **Response:** Returns: `QuestionsResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (Payload) (default: No default) - `questions` (list[QuestionRecord]) (default: No default) - `question` (str): The question (default: No default) - `frequency` (int): The frequency of the question (default: 1) - `nsfw` (bool): Whether the question is NSFW (default: False) **Example:** ```bash curl -X GET '/backend/questions/popular?count=42' ``` --- ### **GET** `/backend/health` Get the health of the backend. **Response:** Returns: `BackendHealthResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (Payload) (default: No default) - `message` (str): The health status of the backend service (default: No default) - `code` (int): The status code of the health check (default: No default) **Example:** ```bash curl -X GET '/backend/health' ``` --- ### **GET** `/backend/version` Get the backend version **Response:** Returns: `BackendVersionResponse` - `uuid` (UUID) (default: No default) - `timestamp` (datetime) (default: No default) - `payload` (Payload) (default: No default) - `version` (str): The version of the backend service (default: No default) **Example:** ```bash curl -X GET '/backend/version' ``` ---