It probably depend on what you want to do with these informations and on the number of points on which you want apply this.
1) If you have not many points you can maybe try to do this with the overpass API. Trying to get the closest road around your pair of coordinates.
It might look like this :
You can take a small radius (like 1) and increasing it if you dont have result. Depending on what you want to do with your data, but this should provide you the infos you want (if you dont need geometry you can use out; instead of out geom;). It might be useful to have some basics in a scripting language to make the queries (increasing the radius if no result, etc.) and to process the data retrieved (or/and you can use a library like overpy which provide python bindings for the overpass API).
2) If you have many points, maybe you can have a look on the photon project, it's a geocoder based on elasticsearch and nominatim. I think you can make a reverse geocoding request and get the road type (at least the value for the key "highway" and the corresping osm id) with a local instance of this geocoder. The reverse API is not really documented on the main page but here.
Hope that it can help you.