An open API service indexing awesome lists of open source software.

https://github.com/fantox/search-it

A simple yahoo search scraper
https://github.com/fantox/search-it

google google-search google-search-api yahoo yahoo-api yahoo-search

Last synced: 2 months ago
JSON representation

A simple yahoo search scraper

Awesome Lists containing this project

README

          

@fantox01/search-it

The simplest yet most powerful web search scraper







# Description:

- A scraper that searches the web and returns structured results including the page title, URL, and description.
- Supports both ES5 and ES6 JavaScript, plus TypeScript.
- Zero external runtime dependencies — built with Node's native `https` module and [Cheerio](https://github.com/cheeriojs/cheerio).
- Scraping a website is not always allowed by the website owners. This project is made for educational purposes only.


# Installation:

```
npm i @fantox01/search-it
```

```
yarn add @fantox01/search-it
```


## Usage:

- For ES5 Javascript

```js
const { searchit } = require("@fantox01/search-it");

const main = async () => {
const data = await searchit("cloudflare", 5);
console.log(data);
};
main();
```


- For ES6 Javascript / Typescript

```js
import { searchit } from "@fantox01/search-it";

const main = async () => {
const data = await searchit("cloudflare", 5);
console.log(data);
};
main();
```


## Output:

- Returns an array of result objects, each with `index`, `page`, `url`, and `desc`.

```js
[
{
index: 0,
page: 'Connect, protect, and build everywhere | Cloudflare',
url: 'https://www.cloudflare.com/',
desc: 'Agents are the future of AI, and Cloudflare is the best place to get started...'
},
{
index: 1,
page: 'Cloudflare - Wikipedia',
url: 'https://en.wikipedia.org/wiki/Cloudflare',
desc: 'Cloudflare, Inc. is an American technology company...'
},
...
]
```


# Making of @fantox01/search-it

## How?

- Using [Cheerio](https://github.com/cheeriojs/cheerio) and Node's built-in `https` module
- **Cheerio -** A fast, flexible, and elegant library for parsing and manipulating HTML and XML.

## Why?

- IDK, scraping is fun to me and also legal up to a limited extend as long as you don't misuse it.

# Contributions

- Made by [FantoX](https://github.com/FantoX)
- I don't have any other contributors in this project yet. Feel free to contribute.


# Support me

- Give this project a 🌟 if you like my project.
- Please follow me on GitHub to get notified about my upcoming projects.