A query parameter is a named key-value item in the query string, the part of a URL after ?. Parameters are separated by ampersands and carry request information or application state. In Streamlit, st.query_params provides a dictionary-like way to read and update them. section 7.6.1
A query string
In https://duckduckgo.com/?t=h_&q=streamlit&ia=web, the query parameters are t=h_, q=streamlit, and ia=web. A dashboard might instead encode selections such as start_date, end_date, and product_name. section 7.6.1
Use query parameters to make an app state visible, shareable, and restorable:
- Read a value with st.query_params.get(key, None), or assign a value such as st.query_params["pie_chart_dimension"] = "Gender". section 7.6.1
- Populate widget defaults from URL values when the app first loads, then update the URL whenever users change widget selections. section 7.6.1 section 7.6.3
- Prefix widget keys with w: so only selected widget state enters the URL, while other session-state values remain internal. section 7.6.3
Figure 7.15 Approach to implementing deeplinking
Follow the deeplinking flow from URL values to widget defaults and back to updated URL state. section 7.6.1






























