WeatherKit REST API attribution logo when not using the Swift wrappers

If you use the iOS16 Swift WeatherKit API you can get the weather data attribution logo doing something like:

// Skipping full syntax for example let attribution = WeatherService.shared.attribution

// A URL to an image you can show along with the weather data attribution.combinedMarkLightURL

What about if you are not using the iOS16 WeatherKit wrappers e.g. you are using the REST API on your own server to return data. The API docs show a providerLogo/providerName parameter in the metadata returned from the service, but they don't seem to be populated right now.

Is it ok just to use a unicode Apple logo to make a string instead like:  Weather

Also in the API there is a metadata object returned in each dataset e.g. current, daily, hourly which each has an attributionURL field, will all those values always be the same or we might have to display multiple URLs for data sources, the Swift example seems to just have one attribution object.

Post not yet marked as solved Up vote post of markdaws Down vote post of markdaws
1.6k views

Replies

I have a similar question. The way I want to insert my weather data is on a page that doesn't have a lot of space so I just wanted to put a text line that said " Weather: Clear with a High of 77 °F" or whatever the actual daily forecast is. Would that meet the attribution requirements?

Here's the answer I received from Apple DTS.

As for attribution, there is a REST API call for attribution, though looking at the documentation, I see it is not listed. I've already filed a request to have that added (r. 102144735). I encourage you to file your own feedback about this; feel free to reference the bug I filed when you do so. https://feedbackassistant.apple.com.

The call is 

https://weatherkit.apple.com/attribution/{locale}

which returns JSON, with the attribution images and localized name for WeatherKit in that locale. For example

https://weatherkit.apple.com/attribution/en-US

returns 

{
    "logoDark@3x": "/assets/branding/en/Apple_Weather_wht_en_3X_090122.png",
    "logoLight@1x": "/assets/branding/en/Apple_Weather_blk_en_1X_090122.png",
    "logoDark@2x": "/assets/branding/en/Apple_Weather_wht_en_2X_090122.png",
    "logoDark@1x": "/assets/branding/en/Apple_Weather_wht_en_1X_090122.png",
    "logoLight@2x": "/assets/branding/en/Apple_Weather_blk_en_2X_090122.png",
    "logoLight@3x": "/assets/branding/en/Apple_Weather_blk_en_3X_090122.png",
    "logoSquare@2x": "/assets/branding/square-mark@2x.png",
    "serviceName": "\uf8ff Weather",
    "logoSquare@1x": "/assets/branding/square-mark.png",
    "logoSquare@3x": "/assets/branding/square-mark@3x.png"
}