In this section, we will present a way of collecting the digital data distributed in different sites - starting from their positioning in google maps, related to the naming, in a single database and we aim to rely on these results in the future to create a general application for data collection. To do this we will use:
4.1. Collecting Data for Albanian Agritourism Sites
We begin by installing the Instant Data Scraper extension in Google Chrome. Then we continue using the extension after searching Google with the keyword "Agritourism Shqiperi" and selecting the location option.
This ensures that the search results are tailored to agritourism destinations in Albania. Instant Data Scraper allows us to select and extract specific data fields such as the name, type of service, location, rating, and number of comments from the search results. The extension helps in converting this information into a structured format, such as Excel.
After installing instant data scraper, we are able to retrieve this data:
Figure 1.
Using data scraper.
Figure 1.
Using data scraper.
The downloaded data:
Figure 2.
Results obtained by data scraper.
Figure 2.
Results obtained by data scraper.
This data scraper results are then stored in our database.
- B.
Building and using a web application to retrieve data from places Api
First, we will create a query to retrieve from the google places API all the id of these businesses:
const apiKey = 'OUR_GOOGLE_API_KEY';
const apiUrl = 'https://maps.googleapis.com/maps/api/place/textsearch/json';
const searchQuery = 'agritourism Albania';
const fetchAgritourismPlaces = async () => {
try {
const response = await fetch(`${apiUrl}?query=${encodeURIComponent(searchQuery)}&key=${apiKey}`);
const data = await response.json();
if (data.status === 'OK') {
const agritourismPlaces = data.results;
const placeIds = agritourismPlaces.map(place => place.place_id);
console.log('Agritourism Place IDs:', placeIds);
} else {
console.error('Error fetching data from Google Places API:', data.status);
}
} catch (error) {
console.error('Error fetching data:', error);
}
};
fetchAgritourismPlaces();
We can now retrieve all the id of the agritourism places as the following:
{
"Agroturizëm Harapi":"ChIJB_CgejwDThMRtwAeWABwRmA",
"Agroturizem Faqedol":"ChIJneZJ6C0BThMRuDn3uMOQfMI",
"Agroturizem shega":"ChIJ09QzrAAFThMRqN7EY0EAgsA",
"Mrizi i Zanave - Restorant Agroturizëm":"ChIJZ1msF5rkURMR1mv-ndiy5Sk",
"Hysaj Agroturizëm Restorant & Hotel & Camping":"ChIJTfZdxe79TRMR8xgb1KoWCgg",
"Restorant Agroturizëm Gardenland":"ChIJjaw5uzEdThMRNKGadqcU9XY",
"Agroturizëm Hylli i Dritës":"ChIJ60fCDVnkURMRDMLISKP9lWE",
"Ullishtja Agroturizëm":"ChIJ_6oztHnbTxMRmn95pUlRg40",
"Agroturizëm Rruga e Mullirit":"ChIJwbgBF-j5TRMR0PvomAO9KWM",
"Bonum Agroturizem":"ChIJM-kxR5EvUBMREXBWlzEGIO4",
"Agriturizem Loka":"ChIJLy6eSkgrUBMRPZRPhq2mhjw",
"Agroturizem Marku":"ChIJmTVQXLL_URMR0LQ-MjGBNKo",
"Nëna Dashuri Agroturizëm":"ChIJBe6KHvxzURMR7TYdN7XJt7w",
"Lahuta e Vjetër Agroturizëm":"ChIJ5WcU27rbURMRHYXqasr8vy8",
"KRONOS AGROTURIZEM":"ChIJUX3UBDcpUBMRDO0VdDTINfs",
"Alpeta Agrotourism & Winery (Alpeta Agroturizem)":"ChIJq6qquoGeWhMRELpOwVzp0nM",
"Agroturizëm Ndryshe":"ChIJ1xPI5C61URMRuITXJ1GWDik",
"Agroturizëm Lugina e Agrumeve":"ChIJe-Emjh5vWxMR1I-0O0rSv8Q",
"FAMA - Agroturizem & Argetim":"ChIJbbD4XEfbTxMR37pNRgELq3E",
"Sirena Agroturizëm":"ChIJOcRlSTzfTxMR7B-lc-XJmMI",
"AGROTURIZEM PAJENGA FARM":"ChIJf5O0_yRBUBMRlsYrQn8gS9I",
"Pema e Jetës Agroturizëm":"ChIJG_CqwFjYTxMRILpFGlq2BnA",
"Agroturizëm Kodra e Gjelbër":"ChIJQ5zIxCifWhMRsApkRMEH_3E",
"Agroturizem":"ChIJ6ZVk_v7ZTxMRj9P33DOVqO0",
"Villa Bianca Agriturismo & SPA":"ChIJf-T2CZopUBMRGa89DcgOYbs",
"Aromë Natyre Agroturizëm & Hotel":"ChIJ98arTsQrThMR81bW2qhWLjE",
"Agroturizëm Eldi":"ChIJY1Nnj0xFRRMRCzRvBzYaOHs",
"Agroturizem Gjepali":"ChIJY_GcKNPXTxMR97Z9TIXopAg",
"Agroturizëm Via Egnatia":"ChIJO_M4yYQbUBMR_mBl5L6XioQ",
"Bar Restorant Bardhi Agroturizem":"ChIJOd85eNDNURMROzCAH8Vjw-E",
"Agroturizëm Bylis":"ChIJS-LmTM63WhMRnRlCy02nW1g",
"Farma Sotira":"ChIJQVZkrEBGWhMRf11DxkBToE0",
"Agroturizem Xhon Leti":"ChIJ1x6DYxgzUBMRRohjVVBEalI",
"Agroturizëm Agabeu":"ChIJ6QKwboe7WhMRWFZuT2dJVSE",
"Agroturizëm Cantina Cassar":"ChIJYWYMnb4vUBMRkw_TMwBlaKo",
"Agroturizem Kantina Kopliku":"ChIJJxmm-Sz7TRMR_VprtaJTvLM",
"Mulliri Sali Shijaku Pikë Turistike Bujtinë Agroturizëm":"ChIJPcKkLcA5UBMR-vt1usSjOzY"}
In this step we have created a web application which is able to communicate with the places Api and to extract the needed information automatically or by user search. The application sends requests to the Google Places API using the constructed queries. In response, Google sends back JSON-formatted data containing details such as the name, address, contact information, reviews, photos, websites of this places and other relevant fields for each destination. A piece of code written for this purpose is:
place_id=ChIJZ1msF5rkURMR1mv_ndiy5Sk&fields=name,formatted_address,geometry,types,rating,user_ratings_total,opening_hours,photos,website,formatted_phone_number,international_phone_number,reviews&key=OUR_API_KEY
All the JSON information is stored in a database to be than offered us for study. We take care to build some queries that avoid duplicates or missing information. Information is stored periodically and so we can check the changes and updates.
The main view of this application is:
Figure 3.
The web application we did to collect data from places Api.
Figure 3.
The web application we did to collect data from places Api.
As we can see the main information is shown in the application. Some agritourism destinations are shown directly or we can continue by searching by name or by location or both. This is obtained by sending queries to google places Api by specifying the information needed and show it on the screen.
The main script written to optain the data is as following :




Database Result Tests
Now that we have our database populated with information, we can send queries and retrieve all the information we need. We want to find the five destinations which have their own website and the biggest rating. After the query was send, the database responds us with the results as shown below:
Figure 4.
Top 5 agritourism destinations that have their own website selected by ratings.
Figure 4.
Top 5 agritourism destinations that have their own website selected by ratings.