0

I have this function but zomato keeps on returning it as 403 (invalid API). I am not sure if there are other function/parameters that are needed to fill the user-key

url='https://developers.zomato.com/api/v2.1/search?count=50&lat=111&lon=111&radius=1500&order=desc'
sendGetRequest() {
             const headers = new HttpHeaders()
                 .set('cache-control', 'no-cache')
                 .set('content-type', 'application/json')
                 .set('user-key', 'mykeygoeshere')

             return this.httpClient
                        .get(this.url, '', { headers: headers })
                        .subscribe(res => res.json);
    }   
N B
  • 87
  • 11

1 Answers1

0

I have tried the search request by generating the API key and got the successful response. So you need to have a proper API key.

Request:

curl -X GET --header "Accept: application/json" --header "user-key: a2716934XXXXXXXXXXXX21ced1a5a35" "https://developers.zomato.com/api/v2.1/search"

Response:

{
  "results_found": 1272959,
  "results_start": 0,
  "results_shown": 20,
  "restaurants": [
    {
      "restaurant": {
        "R": {
          "res_id": 17842104
        },
        "apikey": "a2716934XXXXXXXXXXXX21ced1a5a35",
        "id": "17842104",
        "name": "Mr.",
Prasad Bonthu
  • 131
  • 2
  • 13