ArcGIS geo enrichment

12-13-2022 12:59 AM
New Contributor

Hi i wanted to know if "arcgis.geoenrichment" is free?

my code:

from arcgis.gis import GIS
from arcgis.geoenrichment import Country
# hid credentials
gis = GIS(username='*********', password='*********')

pk = Country.get('PK')
pk_states = [state for state in pk.subgeographies.states.items()]
# pk_places = [place for place in pk.subgeographies.states['Punjab'].places.items()][:5]
errors i am facing:
Traceback (most recent call last):
File "", line 7, in <module>
pk_states = [state for state in pk.subgeographies.states.items()]
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/geoenrichment/", line 227, in __getattribute__
val = object.__getattribute__(self, name)
AttributeError: 'NamedArea' object has no attribute 'states'
Traceback (most recent call last):
File "", line 6, in <module>
pk = Country.get('US').subgeographies.states
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/geoenrichment/", line 230, in __getattribute__
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/geoenrichment/", line 237, in _fetch_subgeographies
df = standard_geography_query(
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/geoenrichment/", line 102, in wrapped
return fn_to_call(*args, **kwargs)
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/geoenrichment/", line 1802, in _standard_geography_query_gis
return ge.standard_geography_query(
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/geoenrichment/", line 1225, in standard_geography_query
res =, postdata=params)
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/gis/_impl/_con/", line 1407, in post
return self._handle_response(
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/gis/_impl/_con/", line 900, in _handle_response
self._handle_json_error(data["error"], errorcode)
File "/Users/suleman/.pyenv/versions/3.8.16/lib/python3.8/site-packages/arcgis/gis/_impl/_con/", line 923, in _handle_json_error
raise Exception(errormessage)
Exception: User does not have permissions to access this resource.
0 Kudos
3 Replies
MVP Esteemed Contributor

It requires an arcgis pro license with geoenrichment capabilities enabled on your account or the data doesn't exist for the country in question

00310: GeoEnrichment service is not configured—ArcGIS Pro | Documentation

00312: Country cannot be determined for the Statistical Data Collection or the country is not availa...

plus other links

... sort of retired...
0 Kudos
New Contributor

Just confirming.... do i need to buy a plan or geo-enrichment service to use this info? If yes then can you share me the link where i could buy this service please??

0 Kudos
MVP Esteemed Contributor

From the web

GeoEnrichment service—ArcGIS REST APIs | ArcGIS Developers

under Access the Service gives the requirements

... sort of retired...
0 Kudos