Giter Club home page Giter Club logo

google-api-custom-search-example's Introduction

google-api-custom-search-example

Introduction

This is an example of using the Google Custom Search Engine (CSE) API in Go.

This will search the CSE for keywords and search for a string in the domain and report back the position and response.

Installation

Before you can use the CSE API you will need to create a new Custom Search Engine (CSE). You can create one at https://cse.google.com. After it is created make sure to copy your "Search Engine ID" from the Basics tab.

Now you will also need to create an API key to access your CSE via the API. 1 Visit the Google Developers Console at https://console.developers.google.com 2 Create a new project. 3 Enable and manage APIs 4 Find and enable the Custom Search API 5 Go to Credentials 6 Add Credentials -> Service Account 7 JSON and Save file over search-key.json in the project folder

You are now ready to run go install && go build and run ./google-api-custom-search-example

Using the Command

./google-api-custom-search-example will show usage information.

./google-api-custom-search-example -id [Search Engine ID] -q [Query String] -d [Domain/path to search for]

Remember that with the free CSE version you only get 100 queries a day!

OAuth Instead?

You want to see an OAuth version? Here is the Google API Library in Go Getting Started Guide which should give you a good starting point.

More Information

License

MIT

google-api-custom-search-example's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.