×

ContextualWeb Web, News and Image Search APIs - Quick Start Guide

3. Make your first GET request

In this tutorial, I'd like to try and find images of red pandas. First, I'll choose the imageSearch API endpoint from the left-hand menu.

I can leave the header parameter text fields as-is - they've been automatically filled by RapidAPI.

In my required parameters section, I'll leave autoCorrect on - so that the engine will show the right images even if I make a typo.

I'll leave my pageNumber parameter as is, because I want to see the first results page (useful for server-side pagination).

I'd like to display 10 results per page, so my pageSize parameter is set to 10. My query is "red pandas", and safeSearch is set to "on", just in case.

 

Finally, I just need to tap the blue "Test Endpoint" button, and voila! The code snippets and Response 200 on the right-hand side are updated to match my query.

You'll see that the code snippet matches the actual GET request I made through RapidAPI's interface. To make the same request in my application, all I would need to do is copy and paste the snippet.

The test results includes the actual results I would get if I made this GET request in my app or website.

Here's an example of what a Response 200 might look like for a typical GET request.

https://contextualwebsearch-websearch-v1.p.rapidapi.com/api/Search

/WebSearchAPI?q="Taylor Swift"

{
  "_type": "news",
  "didUMean": "",
  "totalCount": 2311,
  "relatedSearch": [
    "scooter braun",
    "cats",
    "concerts",
    "ariana grande",
    "judi dench",
    "jennifer hudson",
    "taylor swift score 10",
    "trailer",
    "prime day",
    "off drama with fun",
    "new york",
    "stars"
  ],
  "value": [
    {
      "title": "Article title",
      "url": "Article URL",
      "description": "Article description",
      "body": "Body of article",
      "language": "en",
      "isSafe": true,
      "datePublished": "2019-07-29T21:06:00",
      "provider": {
        "name": "Publisher name"
      },
      "image": {
        "url": "Image URL",
        "height": 480,
        "width": 480,
        "thumbnail": "https://contextualwebsearch.com/api/thumbnail/get?value=8452069667708416433",
        "thumbnailHeight": 240,
        "thumbnailWidth": 240,
        "base64Encoding": null
      }
    }
  ]
}