Skip to main content

Get weather information from the OpenWeatherMap service

Extend your product feed with weather information using the OpenWeatherMap data service in Productsup.

Introduction

The OpenWeatherMap data service is a Productsup feature that lets you access the OpenWeather API to add current weather conditions or weather forecasts to your product feed. This data can help you customize images or export weather-relevant product offers.

Using the location data in your product feed, the OpenWeatherMap data service retrieves location-relevant weather data. If you choose to retrieve a basic set of current weather details, the data service adds the following columns to your site:

  • ___open_weather_map_last_updated shows a Unix timestamp of the last run of the data service.

  • ___open_weather_map_1_forecast_time displays weather data creation time as a Unix timestamp.

  • ___open_weather_map_1_temp_avg contains the current average temperature at the location.

  • ___open_weather_map_1_humidity stores the current humidity percentage at the location.

  • ___open_weather_map_1_weather_main gives a simple weather summary, such as Clear or Snow.

  • ___open_weather_map_1_clouds provides the cloudiness percentage at the location.

Note

The OpenWeatherMap data service is available for the import and intermediate stages.

Prerequisites

To set up the OpenWeatherMap data service, you need:

  1. A product identifier. See Set a product identifier.

  2. A column in your feed containing location data to let the data service retrieve relevant weather data.

    This location data can have the following formats:

    1. OpenWeatherMap city IDs.

      Tip

      To find the needed city IDs, you can download a JSON file with all OpenWeatherMap city IDs. See Built-in API request by city ID to find the file link in the Parameters section.

    2. City names and country abbreviations.

      Note

      Country abbreviations should consist of two (2) characters and follow the standard ISO 3166-1 alpha-2.

    3. Postal codes and country abbreviations.

      Note

      Country abbreviations should consist of two (2) characters and follow the standard ISO 3166-1 alpha-2.

    4. Latitude and longitude.

  3. An API key to authenticate in the Weather API. You need to request or purchase it from OpenWeatherMap. See Weather API.

Add the OpenWeatherMap data service

  1. Go to Data Services from your site's main menu and select ADD SERVICE.

  2. Search for OpenWeatherMap, select Add, and give it a desired name and column prefix.

    By default, ___open_weather_map is the column prefix.

    add the OpenWeatherMap data service
  3. Choose the stage containing your location data in Service Data Level and select Add.

    If you choose Import, the drop-down lists in Step 6 display the columns of your import stage. If you choose Intermediate here, these drop-down lists display your intermediate-stage columns.

  4. In API key, enter your Weather API key.

  5. In Forecast, choose what type of weather data you want to import:

    1. Current weather conditions.

    2. A weather forecast for the next five (5) days.

    3. A weather forecast for the next 16 days.

  6. In Location type, choose what type of location data you have in your feed.

    When you choose a specific type of location data, additional fields appear on the data service setup page as follows:

    Location data type

    Additional fields appear

    Expected input

    OpenWeatherMap city id

    OpenWeatherMap city ID column

    Select which column in your feed has city IDs.

    City name & country abbreviation

    City name column

    Select which column in your feed has city names.

    Country column

    Select the column with country codes.

    Postal code & country

    Postal code column

    Select the column with your postal codes.

    Country column

    Choose which column contains country codes.

    Latitude & Longitude

    Latitude column

    Choose the column with latitude data.

    Longitude column

    Choose the column with longitude data.

    Number of cities around the point

    Enter the number of cities at the identified location.

  7. In Weather data, choose what data you want to retrieve:

    1. Basic returns a simple weather description with temperature, humidity, and cloudiness information.

    2. All returns all weather information available to the Weather API, such as day and night temperatures, minimum and maximum daily temperatures, morning and evening temperatures, atmospheric pressure, humidity, wind speed and direction, cloudiness, a simple weather description, and a detailed weather description.

  8. Select the desired metric system in System of measurement for the platform to use for all measurable weather data retrieved via the Weather API:

    • Metric

    • Imperial

    • International System of Units

  9. Text-based weather descriptions are available in a selection of languages. Select the desired option in Language.

  10. If you want the platform to run the data service every time there is a refresh in Data View, select the checkmark icon () in Trigger during a refresh of the Data View.

  11. Select Save.

  12. For the platform to process a new data service, select Import or Run in the top-right corner of your site's view.

    Note

    If you can't see the columns that the OpenWeatherMap data service added to your feed in Data View, ensure the platform hasn't hidden them:

    1. Go to Data View from your site's main menu and choose the relevant stage or export in the drop-down list on your left.

    2. Select the menu icon on the right and then select the eye icon.

    3. Find the attributes in the list that use the custom prefix ___open_weather_map and select the eye icon next to each attribute you want Data View to display.

    4. Close the pop-up menu.

    The naming of the attributes created by the OpenWeatherMap data service depends on the column prefix you chose in Step 2. The attribute names that the data service generates always start with three underscores (___), which means the platform doesn't send those attributes to your export channels.

Edit the OpenWeatherMap data service

  1. Go to Data Services from your site's main menu.

  2. Search for your data service.

  3. Select the cogwheel icon () next to the desired data service to edit settings.

  4. Select Save.

Delete the OpenWeatherMap data service

  1. Go to Data Services from your site's main menu.

  2. Select the cogwheel icon () next to the desired data service.

  3. In the Danger Area panel, select Remove this service.

  4. Select Yes.