22
Apps, Widgets and APIs: Tap into existing tech to streamline your programs Marian Weaver, FMC Dar Knipe, Market Maker Chris Seeger, Iowa State University

Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

Apps, Widgets and APIs: Tap into existing tech to streamline your programs

Marian Weaver, FMCDar Knipe, Market Maker

Chris Seeger, Iowa State University

Page 2: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

Metrics is a data collection and reporting system that empowers market managers to be in control of their data, and to transform that data into actionable information.

Marian WeaverMetrics Program Manager

Two priorities for FMC are to: 1) Professionalize the industry through the use of best in class tools 2) Help markets grow and thrive through the use of data-driven decisions

Farmspread provides a comprehensive online management platform for Farmers Markets, helping to streamline operations while promoting a national directory of markets, vendors and products.

Who We Are:

Presenter
Presentation Notes
1) My job is to help market managers learn to collect and utilize operational market data to further their understanding of their market, and reach their growth goals through data driven promotion and messaging.
Page 3: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

oThe Metrics development roadmap had planned for vendor management tools to be built into Metrics, to further expand the functionality of Metrics for users.

oAfter some exploratory development, we decided that this was more than FMC could take on, so we looked for other ways to offer this functionality to Metrics users.

oFMC met Farmspread in November of 2017, and it became apparent that each of us were moving in the direction that the other had already tackled, so rather than compete, we decided to collaborate.

oWhat followed was an API, which allows markets to use Farmspread for vendor applications and market management, and have that data transfer directly into Metrics. Collect data once, use it twice.

oMarkets that originally just had data for operations, are now expanding that usage into automated analysis and promotion as a result of our API.

A history of how we came to this partnershipHow a partnership fixed a problem

Page 4: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

What is an API, anyway? API: Application Programming Interface

In English: A program written to communicate data from one website/server to another.

What is does: APIs allow for websites and companies to share data across the internet, based on a shared set of parameters that both companies have.

Page 5: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

Current Data Points:• Market Information• Vendor Profile Data

Future Data Points:• Market Sales• Vendor Sales• Market Attendance• Real Time Weather

API

API currently supports 60% of all statistics available in Metrics; by next year it will be over 80%

API

What content are you sharing via API?

Current Data Points:• Market Information• Vendor Profile Data

Future Data Points:• Market Sales• Vendor Sales• Market Attendance• Real Time Weather

Page 6: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

What does this look like to market managers?

API

Page 7: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

How is it working out?

oWe started the project with three markets that were interested in piloting the API; our goal was for ten for our first season.

oThe API was completed in May of 2018, missing the vendor application deadlines for many markets.

oHowever, throughout the season, we acquired 17 more markets that utilized the API; many of them were winter season markets preparing for later this year.

oAs of today, we have 20 markets actively using the API, and over 400 vendors, almost 20% of all vendors represented in the Metrics system, and we have at least 20 more markets in line for the 2019 season.

Page 8: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker
Page 9: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker
Page 10: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker
Page 11: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

The API Solution

• A registration and log in system for farmers market managers and farmers to use with all collaborating directories

• When a user updates a profile it updates all the directories.

• Accounts / profiles can be accessed from any of the web sites of collaborating organizations.

• Designed to be compatible with the USDA Farmers Market Directory.

• Shared data administrative tools

Page 12: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker
Page 13: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker
Page 14: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker
Page 15: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker
Page 16: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

The ISUEO Indicators Program is built upon a collection of APIs and a network of databases (the Indicators Portal) that store and share data to a variety of products.

Page 17: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

Anatomy of an API Request• An API is often an external

resource (endpoint), capable of accepting and responding to requests. Often written in Node, Ruby, Java or ASP.NET etc.

Endpoint Parameters Resulthttps://api.ipify.org ?format=json {"ip":"98.207.254.136"}

?format=json callback({"ip":"98.207.254.136"});?format=jsonp&callback=getip getip({"ip":"98.207.254.136"});<nothing specified> 98.207.254.136

• Check the ‘developers’ link on website footers or in about for API documentation and URL.

• Test samples and search Stack Exchange for help with syntax errors

Page 18: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

Anatomy of an API Response• Some APIs provide access to an ‘Application’ or data. Web

mapping API’s examples: Google Maps, Leaflet, Open Layers, Mapbox

• RESTful APIs can provide various data output formats for the client to consume.

• JSON, XML, CSV response can be used with a webmap, chart or other data visualization.

JSON (minified and hard to read){"zip_codes":[{"zip_code":"50156","distance":13.336,"city":"Madrid","state":"IA"},{"zip_code":"50134","distance":14.124,"city":"Kelley","state":"IA"},{"zip_code":"50152","distance":9.112,"city":"Luther","state":"IA"},{"zip_code":"50013","distance":13.316,"city":"Ames","state":"IA"},{"zip_code":"50011","distance":12.446,"city":"Ames","state":"IA"},{"zip_code":"50012","distance":11.912,"city":"Ames","state":"IA"},{"zip_code":"50031","distance":14.649,"city":"Beaver","state":"IA"},{"zip_code":"50010","distance":14.633,"city":"Ames","state":"IA"},{"zip_code":"50212","distance":10.885,"city":"Ogden","state":"IA"},{"zip_code":"50014","distance":9.112,"city":"Ames","state":"IA"},{"zip_code":"50099","distance":2.589,"city":"Boone","state":"IA"},{"zip_code":"50037","distance":2.472,"city":"Boone","state":"IA"},{"zip_code":"50036","distance":0,"city":"Boone","state":"IA"},{"zip_code":"50105","distance":11.757,"city":"Gilbert","state":"IA

JSON (formatted and easier to read){

"zip_codes": [{

"zip_code": "50156","distance": 13.336,"city": "Madrid","state": "IA"

},{

"zip_code": "50134","distance": 14.124, https://www.zipcodeapi.com/API

Page 19: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

US Census Bureau API• Many API’s utilizing three primary

underlying services• Census Data API (Key required)• Tiger Web REST Service (ArcGIS geometry)• Geocoder REST Service (10,000 record limit)

Geocode: 1307 Florida Ave, Ames, IA 50014

Single Return: Lat/Long; State, County, Tract, Block

Batch Return: CSV of Lat/Long

Census API data formatted into a report. Tiger web returns GeoJSON. Geocoder provides address service.

Page 20: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

Weather API’s • Iowa Environmental Mesonet

• Data sets for time/location• WMS map tiles• Weather summaries

• Open Weather Map• Requires Key• Wide variety of data responses• Paid versions provide more features!

• Dark Sky• Requires Key• Time machine requests• 1,000 free requests per day

http://api.openweathermap.org/data/2.5/weather?q=AMES,IOWA&APPID={key}&units=imperial

{"coord":{"lon":-93.62,"lat":42.03},"weather":[{"id":804,"main":"Clouds", "description":"overcast clouds","icon":"04n"}],"base":"stations","main": {"temp":59.88,"pressure":1024,"humidity":77,"temp_min":56.66,"temp_max":62.96},"visibility":16093,"wind":{"speed":9.17,"deg":60},"clouds":{"all":90},"dt":1536376500,"sys":{"type":1,"id":849,"message":0.0034,"country":"US","sunrise":1536407251,"sunset":1536453349},"id":4846834,"name":"Ames","cod":200}

Page 21: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

USDA QuickStats API

• An on-line database containing official published aggregate estimates related to U.S. agricultural production.

• Requires a Key

• API request below returns JSON of 2012 Apple production in Boone County, Iowa.

https://quickstats.nass.usda.gov/api/api_GET/?key= {key}&commodity_desc=APPLES&year=2012&state_alpha=IA&county_name=BOONE&format=JSON Iowa State University is currently using multiple API data

sources data to develop a producer/market report.

Page 22: Apps, Widgets and APIs: Tap into existing tech to ...€¦ · Apps, Widgets and APIs: Tap into existing tech to streamline your programs. Marian Weaver, FMC. Dar Knipe, Market Maker

Questions?