As long as the parameters are not modified in the definition, they will keep the same IDs.
It is not possible to define the IDs of parameters created from the Grasshopper definition. However, you can easily identify a parameter by the name defined in the Grasshopper definition. If unique names are defined, they can be used as IDs.
You can output data from Grasshopper by using the ShapeDiverDataOutput component. You can then find this data with the API by calling api.scene.getData() - with optional filters.