--- title: "system.historian.queryAnnotations" description: "Queries annotations for the specified historian." --- # system.historian.queryAnnotations > Queries annotations for the specified historian. This function is used in **Python Scripting**. ## Description Queries annotations for the specified historian's set of paths within a given time range. ## Client Permission Restrictions This scripting function has no [Client Permission](../../../ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax `system.historian.queryAnnotations(paths, startDate, [endDate], [allowedTypes])` ### Parameters |Type| Parameter| Description| |--|--|--| |List| `paths`|A list of historical paths to query annotations for. See [Path Syntax](appendix/scripting-functions/system-historian/system-historian.md#path-syntax) for more information on recommended syntax. | |Date |`startDate` |A start time to query annotations for.| |Date |`endDate` |An end time to query annotations for. [optional]| |List |`allowedTypes` |A list of string types to query annotations for. [optional] Available options include:**note**: User-stored text note**marker**: Point-in-time marker**range**: Date range indicator, requires an endTime value**trace**: X-trace marker| ### Returns **Results** - A [Results](https://sdk.inductiveautomation.com/javadoc/ignition83/8.3.6/com/inductiveautomation/ignition/common/browsing/Results.html) object that contains a list of query results. ### Scope Gateway, Vision Client, Perspective Session ## Code Examples ```python title="Code Snippet" # Query for a specified tag's annotations and display the result. paths = "histprov:QuestDB_Historian:/sys:Historian-gw1:/prov:default:/tag:MetaFolder/MetaTag1" endDate = system.date.now() startDate = system.date.addHours(endDate, -5) results = system.historian.queryAnnotations(paths, startDate, endDate) for result in results.getResults(): print result ```