Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/shredd0r/weather-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/shredd0r/weather-api

  • v0.0.0-20240906114727-97e9b4a77751
  • Source
  • Go
  • Socket score

Version published
Created
Source

Weather API

Requirements

  • docker engine

This app get weather from open source and store the information about weather to cache. Api realized by Graphql.

There are 4 api`s:

  • findGeocoding
  • currentWeather
  • hourlyWeather
  • dailyWeather

Example request current weather:

query {
    currentWeather(input: {
        coords: {
            latitude: 50.026501
            longitude: 36.239391
        }
        locale: "uk-ua"
        unit: "metric"
        forecaster: "AccuWeather"
    }) {
        epochTime
        visibility
        currentTemperature
        minTemperature
        maxTemperature
        feelsLikeTemperature
        iconId
        mobileLink
        link
    }
}
{
  "data": {
    "currentWeather": {
      "epochTime": 1722781620,
      "visibility": 24.1,
      "currentTemperature": 32.6,
      "minTemperature": null,
      "MaxTemperature": null,
      "FeelsLikeTemperature": 31.1,
      "weatherId": "01",
      "mobileLink": "http://www.accuweather.com/uk/tr/yagmur/1284006/current-weather/1284006",
      "Link": "http://www.accuweather.com/uk/tr/yagmur/1284006/current-weather/1284006"
    }
  }
}

Start

  1. Create file .env in app directory with variables from dev.env
  2. In variables with api keys set your keys
  3. run command in app directory: docker-compose up -d

Component have sandbox where you can create requests for all apies. If you want enable this sandbox, add in .env file:

  • SERVER_PORT=8080
  • SERVER_PLAYGROUND_ENABLE=true

After start docker compose, follow the link localhost:8080

Features

  • add another forecaster

FAQs

Package last updated on 06 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc