Select to view content in your preferred language

API access to a map/layer someone else created?

888
4
Jump to solution
04-22-2021 10:30 AM
JChrisHardie
New Contributor II

Hello! A local government body created a map layer in ArcGIS that shows the districts in our local city council along with which elected official represents each district. I'm interested in creating a standalone tool to let someone enter their mailing address and see which district they are in / who their representative is. I'd like to use an API to integrate this with some other tools, instead of sending users to the map link. 

I've read through the REST API documentation a bit but as I'm new to ArcGIS and the related terminology, it's not clear to me if there's a way to do this. Is this possible? Would it require collaboration with or approval from the government body that created the map? Any suggestions or pointers are much appreciated. Thank you.

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

If it's a public layer, you can add it as a layer to any other map using the service URL.

You can find the service URL by watching your browser's network traffic. You'll see something like this:

https://services3.arcgis.com/fhBemP00ea7p7i0U/arcgis/rest/services/Census_Data/FeatureServer/0

If you're using someone else's layer in your map, it's never wrong to start a conversation about it, just to make sure they feel okay with what you're doing. But at the same time, it is a public layer, so anyone can pull this service into any map viewer that's compatible with the data format.

- Josh Carlson
Kendall County GIS

View solution in original post

4 Replies
jcarlson
MVP Esteemed Contributor

If it's a public layer, you can add it as a layer to any other map using the service URL.

You can find the service URL by watching your browser's network traffic. You'll see something like this:

https://services3.arcgis.com/fhBemP00ea7p7i0U/arcgis/rest/services/Census_Data/FeatureServer/0

If you're using someone else's layer in your map, it's never wrong to start a conversation about it, just to make sure they feel okay with what you're doing. But at the same time, it is a public layer, so anyone can pull this service into any map viewer that's compatible with the data format.

- Josh Carlson
Kendall County GIS
JChrisHardie
New Contributor II

Thanks @jcarlson! Sorry for my ignorance here, but does being able to "add it as a layer to any other map" also translate to being able to access its data via the REST API? Or is what you're saying that I would need to add it to my own map first and then I could access that map's data via the API?

0 Kudos
jcarlson
MVP Esteemed Contributor

Yes, it would translate to data access via the API.

https://services3.arcgis.com/fhBemP00ea7p7i0U/arcgis/rest/services/Census_Data/FeatureServer/0/query...

Edit: I may not have grabbed the specific layer you want for my example, but if you have the correct service URL, you can post all sorts of queries and access the attributes of the returned feature with no problem.

- Josh Carlson
Kendall County GIS
JChrisHardie
New Contributor II

Amazing. Thanks so much.

0 Kudos