{"id":2189,"date":"2022-10-09T14:43:18","date_gmt":"2022-10-09T13:43:18","guid":{"rendered":"https:\/\/mywindsock.com\/page\/?page_id=2189"},"modified":"2022-10-18T17:22:55","modified_gmt":"2022-10-18T16:22:55","slug":"request","status":"publish","type":"page","link":"https:\/\/mywindsock.com\/page\/api\/metrics-api-documentation\/request\/","title":{"rendered":"Request"},"content":{"rendered":"\n<p>The Metrics API gives you access to cycling specific weather metrics. The processing of your request may take a few seconds. This is due to the processing and retrieval of route and forecast data. We recommend to you prefetch and store the output, or display the output asynchronously, so as to avoid page loading issues.<\/p>\n\n\n\n<h2>Endpoint<\/h2>\n\n\n\n<p>POST | GET<\/p>\n\n\n\n<p>https:\/\/mywindsock.com\/api\/metrics\/v1\/<\/p>\n\n\n\n<h2>Passing Credentials<\/h2>\n\n\n\n<p>Every request must include your access credentials. These can be passed by either in the request string. If you do not have an API Client ID you must <a href=\"https:\/\/mywindsock.com\/page\/api\/apply-for-api-access\/\" data-type=\"page\" data-id=\"2201\">apply here<\/a>.<\/p>\n\n\n\n<p><strong>client_id<\/strong><\/p>\n\n\n\n<p><strong>api_key<\/strong><\/p>\n\n\n\n<h2>Passing Source Data<\/h2>\n\n\n\n<p><strong>source<\/strong><br>Required. Defines the type of source data<br>Allowed inputs: gpx | tcx | course | strava_segment | strava_route | strava_activity <\/p>\n\n\n\n<p><strong>url<\/strong><br>Required for GPX or TCX sources.<\/p>\n\n\n\n<p> <strong>id<\/strong><br>Required for, Strava, Course or CTT sources.<\/p>\n\n\n\n<p><strong>timestamp<\/strong> (unix time)<br>Not required for TCX files unless the TCX route is to be used as a forecast. UTC timestamp for the forecast start. Timestamps that are in the past, will source observed conditions. Timestamps in the future will source forecast conditions.<\/p>\n\n\n\n<h2>Passing Athlete Parameters<\/h2>\n\n\n\n<p>For a customised forecast a Virtual Athlete must be defined. For forecasts this allows our models to calculate anticipated progress. For past rides this allows us to calculate metrics personalised to the athlete.<\/p>\n\n\n\n<p><strong>va=<\/strong>JSON Virtual Athlete Object<\/p>\n\n\n\n<h3>Virtual Athlete JSON Object<\/h3>\n\n\n\n<p><strong>weight<\/strong> (float)<br>Required. In Kg the total weight of rider, bike and equipment combined.<\/p>\n\n\n\n<p><strong>watts_up<\/strong> (float)<br>Power in Watts, when ascending hills.<\/p>\n\n\n\n<p><strong>watts <\/strong>(float)<br>Required. Power in Watts, when riding on the flat.<\/p>\n\n\n\n<p><strong>watts_down<\/strong> (float)<br>Power in Watts, when descending.<\/p>\n\n\n\n<p><strong>dtl<\/strong> (float)<br>Expected losses from the drivetrain. Only required where power has been determined above the bicycle transmission. <br>Expected Value: 0-100<\/p>\n\n\n\n<p><strong>cda (float)<\/strong><br>The average CdA, Aerodynamic efficiency.<br>Expected Value: &gt;0.000<\/p>\n\n\n\n<p><strong>rr (float)<\/strong><br>Rolling Resistnace Coefficient.<br>Expected Value: &gt;0.0000<\/p>\n\n\n\n<h2>Selecting Output<\/h2>\n\n\n\n<p><strong>output (comma separated list)<\/strong><\/p>\n\n\n\n<p>As default the following objects will be returned, averages, minvalues, maxvalues and totals. You can customise the output by including the &#8216;output&#8217; parameter in your request. Note: the &#8216;totals object&#8217; is always returned.<\/p>\n\n\n\n<p>&#8220;&amp;output=averages,totals&#8221; will include only the averages and totals objects.<\/p>\n\n\n\n<p>Available objects are:<\/p>\n\n\n\n<ul><li>averages<\/li><li>minvalues<\/li><li>maxvalues<\/li><li>totals<\/li><li>stream_time<\/li><li>stream_distance<\/li><li>stream_temperature<\/li><li>stream_elevation<\/li><li>climbs<\/li><li>headwinds<\/li><\/ul>\n\n\n\n<h2>Choosing Units<\/h2>\n\n\n\n<p><strong>unit_speed (string)<\/strong><br>Any speed values will be provided in the chosen unit. Default is kmh.<br>Expected Values: kmh  | mph<\/p>\n\n\n\n<p><strong>unit_wind_speed (string)<\/strong><br>Any wind speed values will be provided in the chosen unit. Default is ms.<br>Expected Values: ms | kmh  | mph <\/p>\n\n\n\n<h2>Other Parmeters<\/h2>\n\n\n\n<p><strong>tag<\/strong> (string)<br>Allows you to group your access requests in our reports. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Metrics API gives you access to cycling specific weather metrics. The processing of your request may take a few seconds. This is due to the processing and retrieval of route and forecast data. We recommend to you prefetch and store the output, or display the output asynchronously, so as to avoid page loading issues. &hellip; <a href=\"https:\/\/mywindsock.com\/page\/api\/metrics-api-documentation\/request\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Request&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2204,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/mywindsock.com\/page\/wp-json\/wp\/v2\/pages\/2189"}],"collection":[{"href":"https:\/\/mywindsock.com\/page\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mywindsock.com\/page\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mywindsock.com\/page\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mywindsock.com\/page\/wp-json\/wp\/v2\/comments?post=2189"}],"version-history":[{"count":18,"href":"https:\/\/mywindsock.com\/page\/wp-json\/wp\/v2\/pages\/2189\/revisions"}],"predecessor-version":[{"id":2243,"href":"https:\/\/mywindsock.com\/page\/wp-json\/wp\/v2\/pages\/2189\/revisions\/2243"}],"up":[{"embeddable":true,"href":"https:\/\/mywindsock.com\/page\/wp-json\/wp\/v2\/pages\/2204"}],"wp:attachment":[{"href":"https:\/\/mywindsock.com\/page\/wp-json\/wp\/v2\/media?parent=2189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}