URL is not coming with params using latest api

Please take a moment to search the forum and documentation before posting a new topic.
If you’re creating a debugging post, please include the following info:

  1. Are you running your app locally or is it deployed? yes
  2. If your app is deployed:
    a. Is it deployed on Community Cloud or another hosting platform?
    b. Share the link to the public deployed app.
  3. Share the link to your app’s public GitHub repository (including a requirements file).
  4. Share the full text of the error message (not a screenshot).
  5. Share the Streamlit and Python versions. - Streamlit, version 1.41.1 and Python 3.9.19

Code with old api showing URL with Params

DEFAULT_PARAMS = {
    "route_number": "1106",
    "route_date": "2024-11-18",
    "database_name_identifier": "TRUX_M3_COMP",
}

query_params = st.experimental_get_query_params()

route_number = query_params.get("route_number", DEFAULT_PARAMS["route_number"])
route_date = query_params.get("route_date", DEFAULT_PARAMS["route_date"])
database_name_identifier = query_params.get("database_name_identifier", DEFAULT_PARAMS["database_name_identifier"])

if not query_params:
    st.experimental_set_query_params(
    route_number=route_number,
    route_date=route_date,
    database_name_identifier=database_name_identifier,
    )

But when I changed to latest api, url is not coming with params

query_params = st.query_params

route_number = query_params.get("route_number", [DEFAULT_PARAMS["route_number"]])[0]
route_date = query_params.get("route_date", [DEFAULT_PARAMS["route_date"]])[0]
database_name_identifier = query_params.get("database_name_identifier", [DEFAULT_PARAMS["database_name_identifier"]])[0]

if not query_params:
    st.query_params = {
        "route_number": route_number,
        "route_date": route_date,
        "database_name_identifier": database_name_identifier,
    }

I m not sure what m I missing.

The API changed significantly from the experimental version to the current one. I’m not understanding what you mean by “URL is not coming with params” though. Can you be more specific about what problem you are having? (With the changed API, it’s expected that you’ll need corresponding code updates.)