Skip to content

matheuspor/mma-fights-scraper-api

Repository files navigation

🥊MMA Fights Scraper API

🤼‍ Scrapes upcoming fights schedule and serves data in JSON format

Repository license GitHub workflow status Repository top language Test-coverage Quality Gate Status

AboutApi DocsUsageRun Locally

About

⚒️REST API built with Typescript, Express, Cheerio.
Scrapes UFC Events pages to get every fight from each event and serves in its endpoints.

Api Docs

Run in Insomnia}

Usage

Get list of upcoming events

Example Request:

GET http://mmafightsscraperapi-env.eba-zihpvn2j.us-east-1.elasticbeanstalk.com/api/events

Response:

[ {
  "_id": "...",
  "title": "...",
  "date": "...",
  "event": "...",
  "time": "...",
  "url": ""
}, { ... } ]

Get list of upcoming events with all fights in the event sorted by fighting order

Example Request:

GET http://mmafightsscraperapi-env.eba-zihpvn2j.us-east-1.elasticbeanstalk.com/api/event-card

Response:

[ {
  "_id": '...',
  "fights": [ {
    "redCornerFighter": "...",
    "blueCornerFighter": "..."
  }. { ... } ], 
  }, { ... } ]

Get one event with all fights by event _id

Example Request:

GET http://mmafightsscraperapi-env.eba-zihpvn2j.us-east-1.elasticbeanstalk.com/api/event-card/1

Response:

{
  "_id": '...',
  "fights": [ {
    "redCornerFighter": "...",
    "blueCornerFighter": "..."
  }, { ... } ]
}

Run Locally

This project runs by default on http://localhost:3001
Fill the empty .env if using custom port.

Build containers and start server

# Install docker-compose if not already: "https://docs.docker.com/compose/install/"

# Clone repo
$ git clone https://github.com/matheuspor/mma-fights-scraper-api

# Build containers and start api
$ npm run compose:up

Run Test suite

$ npm run test

Run Test coverage

$ npm run test:coverage

About

Scrapes upcoming fights schedule and returns data in JSON format

Topics

Resources

License

Stars

Watchers

Forks