Hi @aminta,
check out the api-documentation for the /pois
endpoint.
You can pass a GeoJSON to the pois endpoint and specify a buffer in meters around the geometry in which it should search for POIs.
Carefull with high buffer values though, depending on the area you are looking at, it might take a while to return all values.
If you use the /v2/directions/{profile}/geojson
endpoint you can just use the route geometry and pass it to the pois service, like in the following example with a buffer of 20 meters:
{"request":"pois","geometry":{"buffer":20,"geojson":{"coordinates":[[8.681496,49.414601],[8.68147,49.414599],[8.681488,49.41465],[8.681423,49.415698],[8.681423,49.415746],[8.681427,49.415802],[8.681641,49.416539],[8.681656,49.41659],[8.681672,49.416646],[8.681825,49.417081],[8.681875,49.417287],[8.681881,49.417392],[8.682035,49.417389],[8.682107,49.41739],[8.682461,49.417389],[8.682563,49.417388],[8.682676,49.417387],[8.682781,49.417388],[8.683379,49.41738],[8.683595,49.417372],[8.683709,49.417368],[8.685294,49.417365],[8.685359,49.417365],[8.68535,49.41741],[8.685344,49.417457],[8.685299,49.417726],[8.685213,49.41827],[8.68503,49.419215],[8.685015,49.419256],[8.685094,49.419263],[8.686439,49.419404],[8.68651,49.419413],[8.686506,49.41943],[8.68651,49.419413],[8.687039,49.419467],[8.6871,49.419474],[8.687174,49.419482],[8.688301,49.419619],[8.688398,49.41963],[8.690104,49.419828],[8.690123,49.419833],[8.689854,49.420216],[8.689652,49.420514],[8.68963,49.42051],[8.688601,49.420393],[8.687872,49.420318]],"type":"LineString"}}}
Best regards