Car Data

부분 유료
Verified
분류별 Principal APIs | 업데이트됨 a month ago | Data
인기

9.6 / 10

지연 시간

960ms

서비스 수준

100%

Health Check

N/A

모든 토론으로 돌아가기

java intergration

Rapid account: Abdallah Bilal
AbdallahBilal
a month ago

how do i create a search function. where I can search a make and it gives me all the related models? how do i integrate this into my code using its api keys etc. below is something close to what im looking for

public static ApiResponse getDataFromAPIQuick(String searchName) {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(“https://car-data.p.rapidapi.com/cars?limit=25&page=0&make=”+ searchName))
.header(“X-RapidAPI-Key”, “b57e9e276fmsh1f36cc4d7866312p116353jsn1cd48ceedd7e”)
.header(“X-RapidAPI-Host”, “car-data.p.rapidapi.com”)
.method(“GET”, HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입