code.dny.dev/trafikinfo (go): Package trafikinfo provides the necessary primitives to interact with the Trafikinfo API. It contains a query builder that can be used to build up a Request object. You can then xml.Marshal it and pass it on to your favourite HTTP client to retrieve it through a bytes.Buffer.  The data returned by the Trafikinfo API is licensed under Creative Commons CC0: * https://api.trafikinfo.trafikverket.se/DynamicContent/ContentDetails/58e384810bb22118e8041667 * https://creativecommons.org/publicdomain/zero/1.0/.  The API endpoint is available through the Endpoint constant. The only supported endpoint is v2, v1.x is being deprecated by Trafikverket.  The provided structs in the library have a somewhat odd design in that all fields are pointers. This happens because the structs are largely autogenerated from the JSON schema which defines all attributes as optional. This is a consequence of the Include and Exclude primitives which can result in only specific fields being present in the response, or specific fields be excluded.  A number of endpoints return IconID resources, either at the root of the object, or in one of its embedded objects, like TemperatureIconID. Each of these IconID strings can be plugged into a query for the Icon resource. It in turn will give you access to a base64 encoded PNG in the response, as well as a URL at which the icon can be retrieved.  When using certain filters, for example Equals, querying for an attribute with a value that doesn't exist will not result in an error by the API. Instead you'll get an empty response.
Keywords: sweden|trafikinfo|trafikverket|transport