Skip to content

🌦️ Weather Proxy API | TypeScript + Express | Returns clean JSON from WeatherAPI.com for frontend use πŸš€

License

Notifications You must be signed in to change notification settings

firatmio/weather-proxy-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Weather Proxy API in TypeScript

TypeScript License


Overview

A minimal proxy API built with TypeScript and Express.
Fetches weather data from WeatherAPI.com and returns a simplified JSON response for frontend use.


Features

  • Get current weather by city name
  • Clean, developer-friendly JSON format
  • Supports Turkish language descriptions
  • Simple setup with .env configuration
  • Ready for frontend integration

Technologies Used

  • Backend: TypeScript, Node.js, Express
  • HTTP Client: Axios
  • Environment Config: dotenv
  • Weather Provider: WeatherAPI.com

Getting Started

Prerequisites

  • Node.js (v18+ recommended)
  • npm or yarn
  • WeatherAPI API key (free tier available)

Installation & Running

  1. Clone the repository:
git clone https://github.com/firatmio/weather-proxy-api
cd weather-proxy-api
  1. Install dependencies:
npm install
  1. Create a .env file in the project root:
PORT=3000
WEATHER_API_KEY=your_api_key_here
WEATHER_API_URL=http://api.weatherapi.com/v1/current.json
  1. Run in development mode:
npm run dev
  1. Build & run in production:
npm run build
npm start

Example Usage

Request:

GET http://localhost:3000/api/weather?city=Istanbul

Response:

{
  "city": "Istanbul",
  "country": "Turkey",
  "localtime": "2025-08-30 02:40",
  "temperature": 23,
  "feels_like": 24,
  "condition": "ParΓ§alΔ± bulutlu",
  "icon": "//cdn.weatherapi.com/weather/64x64/day/116.png",
  "wind_kph": 12,
  "humidity": 65
}

Project Structure

weather-proxy-api/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts          # Entry point
β”‚   β”œβ”€β”€ routes.ts         # Routes
β”‚   β”œβ”€β”€ weatherService.ts # Weather fetching logic
β”œβ”€β”€ .env                  # Environment variables
β”œβ”€β”€ package.json          # Project metadata
β”œβ”€β”€ tsconfig.json         # TypeScript config
β”œβ”€β”€ LICENSE               # MIT License
└── README.md             # Project documentation

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

🌦️ Weather Proxy API | TypeScript + Express | Returns clean JSON from WeatherAPI.com for frontend use πŸš€

Resources

License

Stars

Watchers

Forks

Contributors