// npm install node-fetch import fetch from 'node-fetch'; const groupId = "org.apache.maven.plugins"; const artifactId = "maven-compiler-plugin"; const url = `http://search.maven.org/solrsearch/select?q=g:"${groupId}"+AND+a:"${artifactId}"`; const response = await fetch(url); const body = await response.json(); const version = body.response.docs[0].latestVersion; console.log(version);