I am trying to use SkyScanner API from Rapidapi with Angular to search for flight prices. here is my code
headers = new Headers();
url:string;
constructor(private _http:HttpClient,) {
this.headers.append('X-RapidAPI-Key', 'MY-KEY');
this.url = 'https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browseroutes/v1.0/IE/EUR/en-GB/{here should be other parameters like destination}' }
I am passing from,to,day,month and year from inputs
getFlightDetail(from,to,day,month,year) : Observable<Iflight>{
return this._http.get<Iflight>(this.url+this.headers)
.pipe(
tap(data => console.log('flightData/error' + JSON.stringify(data))
),
catchError(this.handlerError)
);
}
the issue is when I ran the app I got
401 Unauthorized