• Installs:
  • Today: 4
  • All Time: 36
Developer:usercontextualwebsearch

WebSearch API Package

Free Web Search API. Billions of webpages, images and news with a single API call.

List of Endpoints
This is the list of endpoints this API includes. To add any of the endpoints to your app, please click on “Connect to endpoint” text.
See All
Discussions
user thumbnail
xinoetr: Is this down today?
2018-10-15
user thumbnail
yefirujolo: Amazing service
2018-09-25
user thumbnail
christina.ho: Site image missing
2018-09-14
user thumbnail
ciaranfarley: No XMap Key??
2018-09-10
user thumbnail
balibhavna: Only 50 links for query
2018-08-09
user thumbnail
onlyposau: can I use this API for my Worpress website?
2018-08-09
user thumbnail
poombavai.sivamani: How do I get my X-Mashape-Key?
2018-07-31
user thumbnail
vishalika: Code in PHP for Image Search
2018-07-30
user thumbnail
garethevans: Locale based results
2018-06-25
See All
Readme

Web Search API

Contextual Web

Free and unlimited access to Contextual Web Search Engine. Billions of webpages, images and news with a single API call. The API returns a list of relevant results from a search query which include images, news and related searches.

  • We don't charge you
  • We don't limit you
  • We don't show ads
  • We don't track you

Features

Support

24/7 Email Support: [email protected]

The Technology

Recent developments in Neuroscience and Brain Science have given us a deeper understating on the human brain: The most efficient indexing machine ever built. contextualwebsearch.com mimics the way the human brain indexes memories to create large scale search engines.

Our Vision

contextualwebsearch.com runs on a small cluster of commodity servers with a ridiculously low maintenance costs of only a few hundreds dollars a month. The innovative technology brings down the costs of the search business, moving us closer to our vision: Making large scale indexing systems cheap and easy.

Peter Thiel (PayPal cofounder and an early investor in Facebook) described it in the best way:

“If we’re going to have a real transformation in search, you have to try to be building technologies that will enable you to take something like 10,000 servers that are used for search today and do it with one hundred servers.”

Usage: Sending a request and parsing the response

Note: The code below is for a request with fixed number of resulting items. The pagination version can be used by simply replacing the request parameters

Python 3.x

import requests #install from: http://docs.python-requests.org/en/master/

#Replace the following string value with your valid X-Mashape-Key key.
Your_X_Mashape_Key = "XXXXXXXXXXXXXXXXXXX";

#The query parameters: (update according to your search query)
count = 10 #the number of items to return
q = "Donald%20Trump" #the search query
autoCorrect = True #autoCorrectspelling

response=requests.get("https://contextualwebsearch-websearch-v1.p.mashape.com/api/Search/WebSearchAPI?q={}&count={}&autocorrect={}".format(q, count, autoCorrect),
headers={
"X-Mashape-Key": Your_X_Mashape_Key,
"Accept": "application/json"
}
).json()

#Get the numer of items returned
totalCount = response["totalCount"];

#Get the list of most frequent searches related to the input search query
relatedSearch = response['relatedSearch']

#Go over each resulting item
for webPage in response["value"]:

#Get the web page metadata
    url = webPage["url"]
    title = webPage["title"]
    description = webPage["description"]
    keywords = webPage["keywords"]
    provider = webPage["provider"]["name"]
    datePublished = webPage["datePublished"]

    #Get the web page image (if exists)
    imageUrl = webPage["image"]["url"]
    imageHeight = webPage["image"]["height"]
    imageWidth = webPage["image"]["width"]
    
    thumbnail = webPage["image"]["thumbnail"]
    thumbnailHeight = webPage["image"]["thumbnailHeight"]
    thumbnailWidth == webPage["image"]["thumbnailWidth"]

    #An example: Output the webpage url, title and published date:
    print("Url: %s. Title: %s. Published Date:%s." % (url, title, datePublished))

Node.js

const u = require("unirest"); //intsall from: http://unirest.io/nodejs.html

//Replace the following string value with your valid X-Mashape-Key key.

Your_X_Mashape_Key = "XXXXXXXXXXXXXXXXXXXX";

//The query parameters: (update according to your search query)

count = 10; //the number of items to return
q = "Donald%20Trump"; //the search query
autoCorrect = true; //autoCorrectspelling


u.get("https://contextualwebsearch-websearch-v1.p.mashape.com/api/Search/WebSearchAPI?q=" + q + "&count=" + count + "&autocorrect=" + autoCorrect)
    .header("X-Mashape-Key", Your_X_Mashape_Key)
    .header("X-Mashape-Host", "contextualwebsearch-websearch-v1.p.mashape.com")
    .end(function(result) {

        console.log("HTTP status code: " + result.status);

        //Get the numer of items returned
        totalCount = result.body["totalCount"];

        //Get the list of most frequent searches related to the input search query
        relatedelatedSearch = result.body["relatedSearch"]

        for (i = 0; i < result.body["value"].length; i++) {

            webPage = result.body["value"][i];

            //Get the web page metadata
            url = webPage["url"];
            title = webPage["title"];
            description = webPage["description"];
            keywords = webPage["keywords"];
            provider = webPage["provider"]["name"];
            datePublished = webPage["datePublished"];

            //Get the web page image (if exists)
            imageUrl = webPage["image"]["url"];
            imageHeight = webPage["image"]["height"];
            imageWidth = webPage["image"]["width"];
            
            thumbnail = webPage["image"]["thumbnail"];
            thumbnailHeight = webPage["image"]["thumbnailHeight"];
            thumbnailWidth == webPage["image"]["thumbnailWidth"];

            //An example: Output the webpage url, title and published date:
            console.log("Url: %s. Title: %s. Published Date:%s.\n", url, title, datePublished);
        }

    });

Ruby

require "unirest" # install from: http://unirest.io/ruby.html

#Replace the following string value with your valid X-Mashape-Key key.
Your_X_Mashape_Key = "XXXXXXXXXXXXXXXXXXX"

#The query parameters: (update according to your search query)
count = 10 #the number of items to return
q = "Donald%20Trump" #the search query
autoCorrect = true #autoCorrectspelling

response = Unirest.get "https://contextualwebsearch-websearch-v1.p.mashape.com/api/Search/WebSearchAPI?q=#{q}&count=#{count}&autocorrect=#{autoCorrect}",
  headers:{
    "X-Mashape-Key" => Your_X_Mashape_Key,
    "X-Mashape-Host" => "contextualwebsearch-websearch-v1.p.mashape.com"
  }

#Get the numer of items returned
totalCount = response.body["totalCount"]

#Get the list of most frequent searches related to the input search query
relatedSearch = response.body["relatedSearch"]

#Go over each resulting item
response.body["value"].each do |webPage|
    
    #Get the web page metadata  
    url = webPage["url"]
    title = webPage["title"]
    description = webPage["description"]
    keywords = webPage["keywords"]
    provider = webPage["provider"]["name"]
    datePublished = webPage["datePublished"]

    #Get the web page image (if exists)
    imageUrl = webPage["image"]["url"]
    imageHeight = webPage["image"]["height"]
    imageWidth = webPage["image"]["width"]
    
    thumbnail = webPage["image"]["thumbnail"]
    thumbnailHeight = webPage["image"]["thumbnailHeight"]
    thumbnailWidth = webPage["image"]["thumbnailWidth"]

    #An example: Output the webpage url, title and published date:
    puts "Url: #{url}. Title: #{title}. Published Date: #{datePublished}"

end

c# (.Net)

/// <summary>
/// Performs a Web search and return the results as a SearchResult.
/// </summary>

public static void Test()
{
    //Replace the following string value with your valid X-Mashape-Key key.
    string Your_X_Mashape_Key = "xxxxxxxxxxxxxxxxxxxxx";

    //The query parameters: (update according to your search query)
    int count = 10; //the number of items to return
    string q = "Donald Trump"; //the search query
    bool autoCorrect = true; //autoCorrectspelling

    //Perform the web request and get the response
    var response = Unirest.get(string.Format("https://contextualwebsearch-websearch-v1.p.mashape.com/api/Search/WebSearchAPI?q={0}&count={1}&autocorrect={2}", q, count, autoCorrect))
    .header("X-Mashape-Key", Your_X_Mashape_Key)
    .header("X-Mashape-Host", "contextualwebsearch-websearch-v1.p.mashape.com")
    .asJson<string>();

    //Get the ResponseBody as a JSON
    dynamic jsonBody = JsonConvert.DeserializeObject(response.Body);

    //Parse the results

    //Get the numer of items returned
    int totalCount = (int)jsonBody["totalCount"];

    //Get the list of most frequent searches related to the input search query
    List<string> relatedSearch = JsonConvert.DeserializeObject<List<string>>(jsonBody["relatedSearch"].ToString());

    //Go over each resulting item
    foreach (var webPage in jsonBody["value"])
    {
        //Get the web page metadata
        string url = webPage["url"].ToString();
        string title = webPage["title"].ToString();
        string description = webPage["description"].ToString();
        string keywords = webPage["keywords"].ToString();
        string provider = webPage["provider"]["name"].ToString();
        DateTime datePublished = DateTime.Parse(webPage["datePublished"].ToString());
        
        //Get the web page image (if exists)
        string imageUrl = webPage["image"]["url"].ToString(); 
        int imageHeight = (int)webPage["image"]["height"]; 
        int imageWidth = (int)webPage["image"]["width"]; 
        
        //Get the web page image thumbail (if exists)
        string thumbnail = webPage["image"]["thumbnail"].ToString(); 
        int thumbnailHeight = (int)webPage["image"]["thumbnailHeight"]; 
        int thumbnailidth = (int)webPage["image"]["thumbnailWidth"]; 
        
        //An example: Output the webpage url, title and published date:
        Console.WriteLine(string.Format("Url: {0}. Title: {1}. Published Date:{2}.",
        url,
        title,
        datePublished));
    }
}

https://cse.google.com/cse/all

x
circle
Web Search
$ / m
We will charge your card every month for the plan amount, as well as any overages incurred in the previous month.
?

Oops, we are missing some details

Looks like there are a few missing details that you haven't filled in yet.
These details are important and will help us protect you and let you know about anything new.

x

Why sign up to RapidAPI?

  • integrate
    Integrate APIs into your app
    Ruby, Java, Elixir, Node.js, Phyton, Objective C, Swift, PHP and MORE
  • keys
    Save all API keys in one place
  • notifications
    Get notifications about API changes
  • stats
    Get stats and monitor API connections
__SING_UP_WITH_GITHUB__
__SING_UP_WITH_FACEBOOK__
__SING_UP_WITH_GOOGLE__
  • We're not going to post anything on your wall.
  • We're not planning to spam you.
  • esccloses this view
    x

    Authentication

    Authenticate
    esccloses this view