How to find nearest road(API)

I would like to suggest this one:

(
  way
  [highway~"^(primary|secondary|tertiary|residential)$"]
  [name];
  (around:100,47.9928,37.8052)
>;);out;

This query in action: http://overpass-turbo.eu/s/19s.

As already mentioned, roads are represented by ways in osm. Roads useful for cars are tagged with highway and one of the values “primary”, “secondary”, “tertiary”, “residential”, and so other values probably not applicable to your region. If you would like to include also footways, please add “pedestrian” to the list.

I’ve added a conditional “[name]” to restrict the result to ways that have a name. This excludes unnamed by-lanes, serviceways, footways and so on. It makes sense when you would like to do something with the name of the road afterwards. Drop this condition if you want also unnamed streets.

The “around” finally has got a smaller radius. It is fine to ask again for the same coordinate with bigger radius if you find nothing, but asking for a whole kilometer in advance will in a city center deliver several metabytes of data. There is unfortunately no “just one element” feature yet, so asking again if the result was empty is the best approximation to this.