Search Instruments
Search a project for instruments and annotations that match the search criteria
Last updated
Was this helpful?
Was this helpful?
{
'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