you can definitely dig into the layers in the web map in an application written with our API. this sample loops through the webmap layers to add them to a legend.
it sounds however like you are currently sharing a link to open the original web map (perhaps in the standard arcgis.com viewer?). in order to build out the functionality you describe you would need to be linking to a configurable web application (that loads a web map based on its id) and similarly pulls additional information out of the Url to write a definition query on the fly.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.