Giter Club home page Giter Club logo

scrapper's Introduction

Scrapper API

Scrapper API

Scrapper API is a Node.js API that allows you to scrape website metadata. It retrieves the title, description, image, and URL of a given web page. This API can be used to extract essential information from web pages for various purposes such as building web scrapers, generating previews, or aggregating data.

Installation (Using docker)

To user Scrapper API, run following command:

docker run -p 3000:3000 docker pull ghcr.io/akgoze/scrapper:latest

Installation (Without docker)

To use the Scrapper API, follow these steps:

  1. Clone the repository:

    git clone https://github.com/akgoze/Scrapper.git
  2. Install the dependencies:

    cd Scrapper
    npm install
  3. Start the server:

    npm start

The API server will start running on http://localhost:3000.

API Endpoints

The following endpoints are available in the Scrapper API:

1. GET /scrapper

  • Description: Scrapes the metadata of a given web page.
  • Parameters:
  • url (query parameter): The URL of the web page to scrape.
  • Example: http://localhost:3000/scrapper?url=https://www.example.com

This endpoint retrieves the following metadata from the web page:

  • title: The title of the web page.
  • description: The description of the web page.
  • image: The URL of the image associated with the web page.
  • url: The URL of the web page.

Example response:

{
  "title": "Fatih Akgöze - Frontend Engineer",
  "description": "Hello. My name is Fatih Akgöze. I'm Frontend Engineer.",
  "image": "https://akgoze.dev/Assets/Images/share-image.png",
  "url": "https://akgoze.dev"
}

Error Handling

If an error occurs while scraping the web page or processing the request, the API will respond with a 500 status code and an error message in the response body.

Example error response:

{
  "error": "An error occurred while scraping the web page."
}

## Dependencies

The Scrapper API relies on the following dependencies:

  • Express: A fast, unopinionated, and minimalist web framework for Node.js.
  • Axios: A promise-based HTTP client for making requests to external APIs.
  • Cheerio: A fast, flexible, and lean implementation of core jQuery for parsing HTML.

Support

If you need any help or have questions or feedback regarding the Scrapper API, please feel free to open an issue on the GitHub repository.

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.