How can I get information from wayId or edgeId

Hi,
topic : map-matching
I want to get the tag like ‘motorway’ from edgeId or wayId, and I also want to change the weighting of motorway. What should I do ? Thanks in advance.