Skip to content

This is an Express Application to get pdf link of the given textbook also to get youtube video details of the given topic

Notifications You must be signed in to change notification settings

Nuzaim/searchServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScrapeAPI - Google and YouTube Results Scraper API

ScrapeAPI is a powerful and easy-to-use API for scraping Google search results of a pdf link based on the user given book name and YouTube search results based on a user-defined query.

SerpAPI and a node package youtubei is used for web scraping. SerpAPI is used for google scraping and youtubei is used for YouTube scraping.

SerpAPI Git

Making a Request

All API requests are made via HTTP GET. The base URL for all requests is https://scrapeapi.vercel.app.

Endpoints

Google Search Results

Retrieve Google search results for a given textbook name.

Endpoint:

GET /google/search?q=YOUR_TEXTBOOK 

Query Parameters:

  • q (string, required): The textbook you want to search on Google.

Example Request:

GET /google?q=Samanta D., Classic Data Structures, Prentice Hall India, 2/e, 2009.

YouTube Search Results

Retrieve YouTube search results for a given query.

Endpoint:

GET /youtube?q=YOUR_QUERY

Query Parameters:

  • q (string, required): The query you want to search on YouTube.

Example Request:

GET /youtube?q=Applications of linked list

Response Format

The response for Google search results will be in JSON format. Here is an example response:

{
  "link": "Textbook pdf link"
}

The response for YouTube search results will be in JSON format. Here is an example response:

{
  [
    {
      "id": "Result video link",
      "title": "Result video title",
      "thumbnails": {
        "url": "Result video thumbnail",
	"width": "Result video thumbnail width",
	"height": "Result video thumbnail height"
      }
    },
    {
      "id": "Result video link",
      "title": "Result video title",
      "thumbnails": {
        "url": "Result video thumbnail",
        "width": "Result video thumbnail width",
        "height": "Result video thumbnail height"
      }
    }
  ]
}

Errors

If there are any errors with your request, you will receive a JSON response with an error message and status code. Please refer online for a list of possible error codes and their meanings.

Sample Code

import axios from "axios";
# Example request to scrape Google search results
query = "Textbook name"
url = "https://scrapeapi.vercel.app/google"

#Example request to scrape YouTube search results
query = "Topic name"
url = "https://scrapeapi.vercel.app/youtube"

const response = await axios.get(url, {
    params: {
      q: query
    },
});

if response.status == 200:
    data = response.json()
    # Process the data as needed
else:
    print("Request failed with status code:", response.status)

Support and Contact

If you have any questions, encounter issues, or need assistance, please raise an issue at https://github.com/nuzaim/searchserver/issues

Happy scraping with ScrapeAPI!

About

This is an Express Application to get pdf link of the given textbook also to get youtube video details of the given topic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published