Page cover image

Search Instruments

Search a project for instruments and annotations that match the search criteria

Search instruments and their data

GET https://api.annolab.ai/v1/instrument/search

Search a project for information related to instruments that meet search filter criteria. Returns a maximum of 100 instruments and their annotations per page. If you need individual pdf files exported for each instrument, try using the Export Instruments api

Headers

NameTypeDescription

Authorization*

String

Where you put your api key. Exporting a project requires a key with "Read" permissions. {"Authorization": "Api-Key XXXXXXX-XXXXXXX-XXXXXXX"}

Request Body

NameTypeDescription

projectOwner*

String

Group Name that owns the project (viewable in "All Projects" page)

projectName*

String

Name of the Project where you want to search

tagFilter

Object

Filter search to include/exclude instruments with tags of these types attached. Applies to instrument's source file tags as well. These filters act as an "OR" condition, so specifying two tags means any instrument with either will be returned. {"includeTypes": ["Airframe Inventory"], "excludeTypes": ["Engine Inventory"]}

sourceFilter

String

Filters export to only those instruments that have a source file name equal to sourceFilter

page

Integer

Search result pagination number

{
    'page': 1,
    'hasMorePages': false,
    'results': []
}

Search Result Object

Attribute NameTypeDescription

page

Integer

The page of the search result

hasMorePages

Boolean

Whether the search result has additional pages that can be requested

results

Array of Instrument objects that comprise the search result

{ 
    'page': 1, 
    'hasMorePages': false, 
    'results': []
}
import requests
import time

ANNO_LAB_API_KEY = 'XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'

searchBody = {
  'projectOwner': 'Group Name owning project',
  'projectName': 'Example Project Name',
  'tagFilter': {
    "includeTypes": ["Airframe Inventory"],
    "excludeTypes": ["Engine Inventory"]}
  },
  'sourceFilter': "Test_PDF.pdf"
}

headers = {
  'Authorization': 'Api-Key '+ANNO_LAB_API_KEY,
}

url = 'https://api.annolab.ai/v1/instrument/search'

response = requests.post(url, headers=headers, json=searchBody, stream=True).json()

search_result = response['results']
#Do something with search result here

#Continue paging your search until there are no more pages 
#(only 100 instruments returned per page)
while response['hasMorePages']:
  searchBody['page'] = response['page'] + 1
  response = requests.get(url, headers=headers, json=searchBody, stream=True).json()
  search_result = response['results']
  #Do something with search result here
  

Last updated