--- title: "system.tag.queryAnnotations" description: "Queries annotations stored in the tag history system for a set of paths for a given time range." --- # system.tag.queryAnnotations > Queries annotations stored in the tag history system for a set of paths for a given time range. This function is used in **Python Scripting**. ## Description ## Client Permission Restrictions This scripting function has no [Client Permission](versioned_docs/version-8.3/ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax `system.tag.queryAnnotations(paths, [startTime], [endTime], [types])` ### Parameters Type | Parameter | Description ------- | ------- | ------ List[String]| `paths` | A list of tag paths to query. The paths are equivalent to what would be used for a Tag History Query, and should specify the Source Providers as well. For example, `[HistoryProvider/Gateway:Provider]Path/To/Tag`. Date| `startTime` | The start of the time range. If not defined, defaults to 12 hours ago. [optional] Date| `endTime` | The end of the time range. If not defined, defaults to "now". [optional] List[String]| `types` | A list of string "types" to filter on. Types are defined by the annotations and various subsystems, and may vary with different providers. Possible annotation types are listed on the [system.tag.storeAnnotations](system-functions\system-tag-deprecated\system-tag-storeAnnotations.md) page. [optional] ### Returns **List[Annotation]** - A list of [Annotation](http://sdk.inductiveautomation.com/javadoc/ignition81/8.1.53/com/inductiveautomation/ignition/common/sqltags/history/annotations/Annotation.html) objects that match the query criteria. ### Scope Gateway, Vision Clients, Perspective Sessions ### The Annotation Object Properties on the annotation objects returned by this function can be references by name (i.e., Annotation.storageId). The table below represent properties on the object. | Property | Description | |---|---| | path | Represents the tag path associated with the annotation. | | type | Represents the type of annotation. | | rangeStart | The start time of the annotation. | | rangeEnd | The end time of the annotation. | | data | Any data (such as a description, or user entered text) associated with the annotation. | | storageId | Represents the ID value of the annotation, as listed in the sqlth_annotations table. Used in conjunction with the [system.tag.storeAnnotations](system-functions\system-tag-deprecated\system-tag-storeAnnotations.md) to change existing annotations, and [system.tag.deleteAnnotations](system-functions\system-tag-deprecated\system-tag-deleteAnnotations.md) to remove annotations. | | deleted | Flag representing if the entries are deleted or not. | ## Code Examples ```python title="Example #1" paths = ["[My-Provider]Station_1/ph"] annotations = system.tag.queryAnnotations(paths) for i in annotations: print i.storageId ```