Coder Social home page Coder Social logo

schaferyan / serpapi-nodejs-proxy-server Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 1.39 MB

Proxy server you can use to query SerpApi from a front-end web application.

JavaScript 100.00%
express nodejs-server proxy-server serpapi webscraping webscraping-search

serpapi-nodejs-proxy-server's Introduction

serpapi-nodejs-proxy-server

Getting Started

Make sure you have the lastest version of Node and npm.

  1. Clone this repository.
  2. Rename example.env to .env or create .env and copy/paste text from example.env
  3. Create a free SerpApi account, if you haven't already.
  4. Copy your API key and paste it into your .env file. Configure your PORT number is desired.
  5. Run npm install to install all dependencies.
  6. (Optional) If using VSCode, install the REST Client extension. This is helpful for testing routes.
  7. Set the Access-Control-Allow-Origin header to the name of the domain you will be querying the proxy server from by editing line 15 of server.js:
app.use(cors({ origin: "http://yourdomain.com" }));
  1. Start the server by running npm start
  2. You can now send requests to the proxy server and get back search results from SerpApi. The proxy server supports GET requests in the form of http://localhost:3000/search/?your-query-string and POST requests to http://localhost:3000/search with the search paramaters in the JSON body. You can also send a GET request with just a single keyword that will use hardcoded search parameters to http://localhost:3000/keyword-search/your-keyword.

serpapi-nodejs-proxy-server's People

Contributors

schaferyan avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

misaodev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.