ArcGIS API for JavaScript: Hosted/Extent_polygon (FeatureServer)
Built using the ArcGIS API for JavaScript