Skip to content

Simple web API for scraping DBA (Den Bla Avis) - danish intermediary portal for buying and selling between private individuals.

Notifications You must be signed in to change notification settings

WhereIsMyRum/DBA-API-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DBA API adapter

Why

This project was created because I needed to buy a bed and wanted to learn Go.

What

DBA (Den blå avis) is the largest danish intermediary portal for buying and selling between private individuals. It does not expose a public API though, so it makes it difficult to create anything for tracking new offers etc. I decided to create a simple web scraper that converts the query data into a JSON object, that can be accessed via a Web API.

How

A simple Web API was written in Go, usin Gin HTTP web framework and Colly - Go scraper. A single request makes the server scrap all the pages related to the query on DBA, and return the extracted data as a JSON. Also a Client using the API was created, but it's not a part of this repo and is not publicly available.

How to use

You need to have docker installed. Once that's done add an entry mapping your loopback address to scraper.docker to your host file (or use any of the available proxy servers to do that). Then docker-compose up the hell out of it. The root url is scraper.docker/api, simply append the path you'd use within DBA website and get a beautiful JSON returned. Example: you can get the data from https://dba.dk/biler/biler at http://scraper.docker/api/biler/biler. Enjoy!

Technologies used

  • Go
  • Gin
  • Colly

Created: August 2020

About

Simple web API for scraping DBA (Den Bla Avis) - danish intermediary portal for buying and selling between private individuals.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published