# Downloading and Displaying SVG

**URL:** <https://community.brain-map.org/t/downloading-and-displaying-svg/2868>\
**Category:** Allen Brain Atlas API\
**Created:** [January 8, 2024, 5:52pm UTC](https://community.brain-map.org/t/downloading-and-displaying-svg/2868 "2024-01-08T17:52:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SvenOtto](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/svenotto/32/893_2.png) [@SvenOtto](https://community.brain-map.org/u/SvenOtto)\
**Post date:** [January 8, 2024, 5:52pm UTC](https://community.brain-map.org/t/downloading-and-displaying-svg/2868/1 "2024-01-08T17:52:06Z")

</div>

- [Prototype](https://community.brain-map.org/t/downloading-and-displaying-svg/2868#prototype-1)
- [Examples](https://community.brain-map.org/t/downloading-and-displaying-svg/2868#examples-2)
- [Parameters](https://community.brain-map.org/t/downloading-and-displaying-svg/2868#parameters-3)
- [Returns](https://community.brain-map.org/t/downloading-and-displaying-svg/2868#returns-4)

The SVG download service returns annotations associated with the specified SectionImage as scalable vector graphics (SVG). Examples of annotations that can be retrieved include hot spots and drawings of Structure boundaries on AtlasImages. Add the “groups=” parameter and specify one or more GraphicGroupLabel.id delimited by commas to filter the types of SVG returned.

## Prototype

```auto
http://api.brain-map.org/api/v2/svg_download/[SectionImage.id]?groups=[#, #, #...]

```

## Examples

Find Atlases that have AtlasImages annotated with Structure boundaries, and the relevant GraphicGroupLabel.ids:

```auto
http://api.brain-map.org/api/v2/data/query.xml?criteria= model::Atlas,
rma::include,graphic_group_labels[name$il'Atlas*'],
rma::options[only$eq'atlases.id,atlases.name,graphic_group_labels.id']

```

Download a list of AtlasImages from the “Mouse, P56 Coronal” Atlas (id=1) that have Structure boundary annotations (GraphicGroupLabel.id=28):

```auto
http://api.brain-map.org/api/v2/data/query.csv?criteria= model::AtlasImage,
rma::criteria,atlas_data_set(atlases[id$eq1]),graphic_objects(graphic_group_label[id$eq28]),
rma::options[tabular$eq'sub_images.id'][order$eq'sub_images.id'] &num_rows=all&start_row=0

```

Download the structure boundary annotations (GraphicGroupLabel.id=28) for an AtlasImage (id=100960033) as a file (.svg):

```auto
http://api.brain-map.org/api/v2/svg_download/100960033?groups=28

```

Display SVG in most browsers:

```auto
http://api.brain-map.org/api/v2/svg/100960033?groups=28

```

## Parameters

| filename | Integer | SectionImage.id identifying the SVG to download. |
| --- | --- | --- |
| groups | list of Group.id (optional) | Filter the Groups to include in the SVG |

## Returns

SVG as either a downloaded file or displayed in the browser.

---

<div class="post-metadata">

**Author:** ![julianrode](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@julianrode](https://community.brain-map.org/u/julianrode)\
**Post date:** [October 1, 2025, 6:07pm UTC](https://community.brain-map.org/t/downloading-and-displaying-svg/2868/2 "2025-10-01T18:07:36Z")

</div>

Hi SvenOtto, thank you so much for this guide, it has been a huge help.

When I tried to retrieve the list of AtlasImages, the sub\_image.ids were ordered ascendingly, and not in the order of atlas slices. When setting [order$eq’sub\_images.id’] to [order$eq’sub\_images.section\_number’] it worked fabulously.
