Inspiration
In our current state of economy and late capitalism, consuming ethically produced products is becoming more and more difficult. The Fair Trade certification system provides a guarantee to mindful consumers about the origins of their product, and makes it possible to consciously support fair trade organizations. A current gap in the system is the difficulty of quickly finding local certified businesses. Currently the only available technology to achieve this is a search queried list on the fair trade website, which neither provides a locational context nor ease of use. This is where my business locator comes in.
What it does
The Fair Trade Business Locator is minimalistic in presentation: it simply plots fair trade businesses on a layer atop Google maps. Additionally, more detailed information will appear when the marked businesses are selected.
How I built it
Data Acquisition
I created a Python script to scrape all the data from the fair trade database by spoofing requests and changing the data limit. The address data was piped to Google Maps Geocoding API, and latitude/longitude data added to the original dataset, and saved to a JSON file.
Displaying Data
A webpage was set up to display a Google Maps instance using the JavaScript API. The JSON dataset was then piped in and markers were created for each. The associated information about each business was then formatted to a table which displays when the business is clicked.
Launching
The webpage was hosted statically on my GitHub pages site.
Challenges I ran into
- The first challenge was properly spoofing the request to the database to acquire the original dataset. I had to read through many of the http requests to the page before I could make any sense of their format and parameters.
- The second challenge was the rate limiting of the google geocoding API, 2500 geocode requests per day and the number of fair trade businesses is above 6000. I limited the search to north America for the time being, and the data scraper is set up and optimized to allow for expansion in the future.
- The last challenge I faced is serving the Google Map on a static page and hiding my private API key. For the time being, I have not yet solved this issue, but the consequences are minimal since it is a free key.
Accomplishments that I'm proud of
My greatest accomplishment is successfully pulling all the data from the fair trade website. By the end I managed to get all of the data in a single request. Another accomplishment is my efficient caching system for the geocoding, which significantly reduces the repeat scrape time and the API usage.
What I learned
I learned a lot about data processing and formatting that into a human-friendly format. I also gained a lot of new knowledge about Python, a language that I was previously not comfortable with. Lastly I learned about the fair trade certification and what local opportunities exist to support equal pay for equal work.
What's next for Fair Trade Business Locator
I've already been in contact with a representative from Fair Trade UofT, who will use the locator to promote fair trade at their events and help spread the support of fair trade companies. In terms of development, I will likely add billing to automate the google api and expand the map to the entire world, as well as move the map to a non-static webpage to hide my Google API key.
Log in or sign up for Devpost to join the conversation.