{"id":22033905,"url":"https://github.com/WurshaApps/ngx-prayertimes-api","last_synced_at":"2025-07-23T15:31:29.034Z","repository":{"id":247593758,"uuid":"825523062","full_name":"WurshaApps/ngx-prayertimes-api","owner":"WurshaApps","description":"🕋 🕒 Angular api client for aladhan.com/prayer-times-api","archived":false,"fork":false,"pushed_at":"2025-01-22T00:33:56.000Z","size":1115,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-21T10:51:57.456Z","etag":null,"topics":["angular","api","islam","muslim","prayer-times","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WurshaApps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-08T02:14:44.000Z","updated_at":"2025-02-12T09:30:46.000Z","dependencies_parsed_at":"2024-12-05T13:48:14.294Z","dependency_job_id":null,"html_url":"https://github.com/WurshaApps/ngx-prayertimes-api","commit_stats":null,"previous_names":["wurshaapps/ngx-prayertimes-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WurshaApps/ngx-prayertimes-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WurshaApps%2Fngx-prayertimes-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WurshaApps%2Fngx-prayertimes-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WurshaApps%2Fngx-prayertimes-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WurshaApps%2Fngx-prayertimes-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WurshaApps","download_url":"https://codeload.github.com/WurshaApps/ngx-prayertimes-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WurshaApps%2Fngx-prayertimes-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266704022,"owners_count":23971403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","api","islam","muslim","prayer-times","typescript"],"created_at":"2024-11-30T09:01:45.036Z","updated_at":"2025-07-23T15:31:29.010Z","avatar_url":"https://github.com/WurshaApps.png","language":"TypeScript","funding_links":[],"categories":["Third Party Components","Recently Updated"],"sub_categories":["Dates","[Nov 29, 2024](/content/2024/11/29/README.md)"],"readme":"# ngx-prayertimes-api\n\n[![angular](https://img.shields.io/badge/Angular-18-red?style=flat\u0026logo=angular\u0026logoColor=red)](https://github.com/angular/angular)\n[![npm](https://img.shields.io/badge/NPM-package-red?style=flat\u0026logo=npm)](https://www.npmjs.com/package/@wursha/ngx-prayertimes-api)\n[![github](https://img.shields.io/badge/hosted-github-red?style=flat\u0026logo=github)](https://github.com/WurshaApps/ngx-prayertimes-api)\n[![Build Status](https://img.shields.io/badge/build-passing-brightgreen?style=flat\u0026logo=github)](#contributors)\n[![prettier](https://img.shields.io/badge/styled_with-prettier-334551.svg?style=flat\u0026logo=prettier)](https://github.com/prettier/prettier)\n[![eslint](https://img.shields.io/badge/linted_with-ESLINT-4B32C3.svg?style=flat\u0026logo=eslint)](https://github.com/eslint/eslint)\n[![jasmine](https://img.shields.io/badge/tested_with-jasmine-8a4182.svg?style=flat\u0026logo=jasmine)](https://github.com/jasmine/jasmine)\n[![MIT](https://img.shields.io/packagist/l/doctrine/orm.svg?style=flat)]()\n[![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](https://github.com/WurshaApps/ngx-prayertimes-api/pulls)\n\n\u003e An Angular api client for [Prayer Times API](https://aladhan.com/prayer-times-api)\n\nthat you can use for:\n\n-   Computing prayer times and prayer time calendars via co-ordinates\n-   Computing prayer times and prayer time calendars via city and country\n-   Computing prayer times and prayer time calendars via an address\n-   Computing geographic co-ordinates and timezone by city and country\n\n## Features\n\n-   ✅ Covers all prayertimes APIs.\n-   ✅ Using observable for all requests\n-   ✅ MIT Licensed\n-   ✅ Strongly typed using TypeScript\n-   ✅ Supports standalone Angular.\n\n## Table of Contents\n\n\u003c!-- TOC start (generated with https://github.com/derlin/bitdowntoc) --\u003e\n\n-   [ngx-prayertimes-api](#ngx-prayertimes-api)\n    -   [Features](#features)\n    -   [Table of Contents](#table-of-contents)\n    -   [Installation](#installation)\n        -   [NPM](#npm)\n        -   [Yarn](#yarn)\n        -   [PNPM](#pnpm)\n        -   [Bun](#bun)\n    -   [Getting Started:](#getting-started)\n    -   [Available API endpoints:](#available-api-endpoints)\n        -   [Prayer Times Calendar](#prayer-times-calendar)\n        -   [Prayer Times Calendar by address](#prayer-times-calendar-by-address)\n        -   [Prayer Times Calendar by city](#prayer-times-calendar-by-city)\n        -   [Prayer Times Hijri Calendar](#prayer-times-hijri-calendar)\n        -   [Prayer Times Hijri Calendar by address](#prayer-times-hijri-calendar-by-address)\n        -   [Prayer Times Hijri Calendar by city](#prayer-times-hijri-calendar-by-city)\n        -   [Timings](#timings)\n        -   [Timings By Address](#timings-by-address)\n        -   [Timings By City](#timings-by-city)\n        -   [Prayer Times Methods](#prayer-times-methods)\n    -   [Request models:](#request-models)\n        -   [getCalendarRequest](#getcalendarrequest)\n        -   [getHijriCalendarRequest](#gethijricalendarrequest)\n        -   [getTimingsRequest](#gettimingsrequest)\n        -   [sharedCalendarRequest](#sharedcalendarrequest)\n    -   [Response models:](#response-models-1)\n        -   [baseResponse](#baseresponse)\n        -   [getCalendarResponse](#getcalendarresponse)\n        -   [getTimingsResponse](#gettimingsresponse)\n        -   [getMethodsResponse](#getmethodsresponse)\n    -   [Core Team](#core-team)\n    -   [Other libs from the author](#other-libs-from-the-author)\n\n\u003c!-- TOC end --\u003e\n\n## Installation\n\n### NPM\n\n`npm install @wursha/ngx-prayertimes-api`\n\n### Yarn\n\n`yarn add @wursha/ngx-prayertimes-api`\n\n### PNPM\n\n`pnpm add @wursha/ngx-prayertimes-api`\n\n### Bun\n\n`bun add @wursha/ngx-prayertimes-api`\n\n## Getting Started:\n\nfirst Inject the service `NgxPrayertimesApiService` anywhere you want to use it\n\n```ts\nimport { NgxPrayertimesApiService } from \"ngx-prayertimes-api\";\n\nexport class AppComponent {\n    constructor(public service: NgxPrayertimesApiService) {}\n}\n```\n\nand make sure that `HttpClient` is provided\n\n```ts\nimport { provideHttpClient } from \"@angular/common/http\";\n\nexport const appConfig: ApplicationConfig = {\n    providers: [... , provideHttpClient()],\n};\n```\n\nnow you are ready to use it.\n\n## Available API endpoints:\n\n### Prayer Times Calendar\n\n```ts\ngetCalendar(p: getCalendarRequest): Observable\u003cgetCalendarResponse\u003e\n```\n\nReturns all prayer times for a specific calendar month.\n\n### Prayer Times Calendar by address\n\n```ts\ngetCalendarByAddress(p: getCalendarByAddressRequest): Observable\u003cgetCalendarResponse\u003e\n```\n\nReturns all prayer times for a specific calendar month at a particular address.\n\n### Prayer Times Calendar by city\n\n```ts\ngetCalendarByCity(p: getCalendarByCityRequest): Observable\u003cgetCalendarResponse\u003e\n```\n\nReturns all prayer times for a specific calendar month by City.\n\n### Prayer Times Hijri Calendar\n\n```ts\ngetHijriCalendar(p: getHijriCalendarRequest): Observable\u003cgetCalendarResponse\u003e\n```\n\nReturns all prayer times for a specific Hijri calendar month.\n\n### Prayer Times Hijri Calendar by address\n\n```ts\ngetHijriCalendarByAddress(p: getHijriCalendarByAddressRequest): Observable\u003cgetCalendarResponse\u003e\n```\n\nReturns all prayer times for a specific Hijri calendar month at a particular address.\n\n### Prayer Times Hijri Calendar by city\n\n```ts\ngetHijriCalendarByCity(p: getHijriCalendarByCityRequest): Observable\u003cgetCalendarResponse\u003e\n```\n\nReturns all prayer times for a specific Hijri calendar month by City.\n\n### Timings\n\n```ts\ngetTimings(p: getTimingsRequest): Observable\u003cgetTimingsResponse\u003e\n```\n\nReturns all prayer times for a specific date.\n\n### Timings By Address\n\n```ts\ngetTimingsByAddress(p: getTimingsByAddressRequest): Observable\u003cgetTimingsResponse\u003e\n```\n\nReturns all prayer times for a specific date at a particular address.\n\n### Timings By City\n\n```ts\ngetTimingsByCity(p: getTimingsByCityRequest): Observable\u003cgetTimingsResponse\u003e\n```\n\nReturns all prayer times for a specific date in a particular city.\n\n### Prayer Times Methods\n\n```ts\ngetMethods(): Observable\u003cgetMethodsResponse\u003e\n```\n\nReturns all the prayer times calculation methods supported by this API. For more information on how to use custom methods, see https://aladhan.com/calculation-methods.\n\n## Request models:\n\n### getCalendarRequest\n\n```ts\ninterface getCalendarRequest extends sharedCalendarWithYearMonthRequest {\n    /**\n     * The decimal value for the latitude co-ordinate of the location you want the time computed for. Example: 51.75865125\n     */\n    latitude: number;\n    /**\n     * The decimal value for the longitude co-ordinate of the location you want the time computed for. Example: -1.25387785\n     */\n    longitude: number;\n    /**\n     * A valid timezone name. Example: Europe/London. If you do not specify this, we'll calcuate it using the co-ordinates you provide.\n     */\n    timezonestring?: TimeZone;\n}\n\ninterface getCalendarByAddressRequest extends sharedCalendarWithYearMonthRequest {\n    /**\n     * An address string. Example: 1420 Austin Bluffs Parkway, Colorado Springs, CO OR 25 Hampstead High Street, London, NW3 1RL, United Kingdom OR Sultanahmet Mosque, Istanbul, Turkey\n     */\n    address: string;\n}\n\ninterface getCalendarByCityRequest extends sharedCalendarWithYearMonthRequest {\n    /**\n     * A city name. Example: London\n     */\n    city: string;\n    /**\n     * A country name or 2 character alpha ISO 3166 code. Examples: GB or United Kindom\n     */\n    country: string;\n    /**\n     * State or province. A state name or abbreviation. Examples: Colorado / CO / Punjab / Bengal\n     */\n    state?: string;\n}\n```\n\n### getHijriCalendarRequest\n\n```ts\ninterface getHijriCalendarRequest extends getCalendarRequest {\n    /**\n     * A Hijri calendar year. Example: 1437.\n     */\n    year: number;\n    /**\n     * A Hijri calendar month. Example: 9 or 09 for Ramadan. If not specified, an annual calendar will be returned.\n     */\n    month?: number;\n}\n\ninterface getHijriCalendarByAddressRequest extends getCalendarByAddressRequest {\n    /**\n     * A Hijri calendar year. Example: 1437.\n     */\n    year: number;\n    /**\n     * A Hijri calendar month. Example: 9 or 09 for Ramadan. If not specified, an annual calendar will be returned.\n     */\n    month?: number;\n}\n\ninterface getHijriCalendarByCityRequest extends getCalendarByCityRequest {\n    /**\n     * A Hijri calendar year. Example: 1437.\n     */\n    year: number;\n    /**\n     * A Hijri calendar month. Example: 9 or 09 for Ramadan. If not specified, an annual calendar will be returned.\n     */\n    month?: number;\n}\n```\n\n### getTimingsRequest\n\n```ts\ninterface getTimingsRequest extends sharedCalendarWithDateRequest {\n    /**\n     * The decimal value for the latitude co-ordinate of the location you want the time computed for. Example: 51.75865125\n     */\n    latitude: number;\n    /**\n     * The decimal value for the longitude co-ordinate of the location you want the time computed for. Example: -1.25387785\n     */\n    longitude: number;\n    /**\n     * A valid timezone name. Example: Europe/London. If you do not specify this, we'll calcuate it using the co-ordinates you provide.\n     */\n    timezonestring?: TimeZone;\n}\n\ninterface getTimingsByAddressRequest extends sharedCalendarWithDateRequest {\n    /**\n     * An address string. Example: 1420 Austin Bluffs Parkway, Colorado Springs, CO OR 25 Hampstead High Street, London, NW3 1RL, United Kingdom OR Sultanahmet Mosque, Istanbul, Turkey\n     */\n    address: string;\n}\n\ninterface getTimingsByCityRequest extends sharedCalendarWithDateRequest {\n    /**\n     * A city name. Example: London\n     */\n    city: string;\n    /**\n     * A country name or 2 character alpha ISO 3166 code. Examples: GB or United Kindom\n     */\n    country: string;\n    /**\n     * State or province. A state name or abbreviation. Examples: Colorado / CO / Punjab / Bengal\n     */\n    state?: string;\n}\n```\n\n### sharedCalendarRequest\n\n```ts\ninterface sharedCalendarWithYearMonthRequest extends sharedCalendarRequest {\n    /**\n     * A gregorian calendar year. Example: 2014.\n     */\n    year: number;\n    /**\n     * A gregorian calendar month. Example: 8 or 08 for August. If not specified, an annual calendar will be returned.\n     */\n    month?: number;\n}\n\ninterface sharedCalendarWithDateRequest extends sharedCalendarRequest {\n    /**\n     * Default's to the current date via an HTTP 301.\n     */\n    date: Date;\n}\n\ninterface sharedCalendarRequest {\n    /**\n     * A prayer times calculation method. Methods identify various schools of thought about how to compute the timings. If not specified, it defaults to the closest authority based on the location or co-ordinates specified in the API call.\n     */\n    method: calculationMethods;\n    /**\n     * Which Shafaq to use if the method is Moonsighting Commitee Worldwide. Defaults to 'general'.\n     */\n    shafaq?: \"general\" | \"ahmer\" | \"abyad\";\n    /**\n     * Comma Separated String of integers to offset timings returned by the API in minutes. Example: 5,3,5,7,9,7. See https://aladhan.com/calculation-methods\n     */\n    tune?: string;\n    /**\n     * If you leave this empty, it defaults to Shafii.\n     */\n    school?: schoolTypes;\n    /**\n     * If you leave this empty, it defaults to Standard.\n     */\n    midnightMode?: midnightModes;\n    /**\n     * Method for adjusting times higher latitudes - for instance, if you are checking timings in the UK or Sweden.\n     */\n    latitudeAdjustmentMethod?: latitudeAdjustmentMethods;\n    /**\n     * Number of days to adjust hijri date(s). Example: 1 or 2 or -1 or -2\n     */\n    adjustment?: 1 | 2 | -1 | -2;\n    /**\n     * Whether to return the prayer times in the iso8601 format. Example: true will return 2020-07-01T02:56:00+01:00 instead of 02:56\n     */\n    iso8601?: boolean;\n}\n```\n\n## Response models:\n\n### baseResponse\n\n```ts\ninterface baseResponse\u003cT\u003e {\n    code: number;\n    status: string;\n    data: T;\n}\n```\n\n### getCalendarResponse\n\n```ts\ntype getCalendarResponse = baseResponse\u003ccalendarData[]\u003e;\n\ninterface calendarData {\n    timings: {\n        Fajr: string;\n        Sunrise: string;\n        Dhuhr: string;\n        Asr: string;\n        Sunset: string;\n        Maghrib: string;\n        Isha: string;\n        Imsak: string;\n        Midnight: string;\n    };\n    date: {\n        readable: string;\n        timestamp: string;\n        gregorian: calendarDataDate\u003c\"greg\"\u003e;\n        hijri: calendarDataDate\u003c\"hijri\"\u003e;\n    };\n    meta: calendarDataMeta;\n}\n\ntype calendarDataDate\u003cT extends string\u003e = {\n    date: string;\n    format: string;\n    day: string;\n    year: string;\n    designation: {\n        abbreviated: string;\n        expanded: string;\n    };\n} \u0026 T extends \"hijri\"\n    ? {\n          weekday: { en: string; ar: string };\n          month: { number: number; en: string; ar: string };\n          holidays: string[];\n      }\n    : {\n          weekday: { en: string };\n          month: { number: number; en: string };\n      };\n\ninterface calendarDataMeta {\n    latitude: number;\n    longitude: number;\n    timezone: string;\n    method: method;\n    latitudeAdjustmentMethod: string;\n    midnightMode: string;\n    school: string;\n    offset: {\n        Imsak: number;\n        Fajr: number;\n        Sunrise: number;\n        Dhuhr: number;\n        Asr: number;\n        Maghrib: number;\n        Sunset: number;\n        Isha: number;\n        Midnight: number;\n    };\n}\n```\n\n### getTimingsResponse\n\n```ts\ntype getTimingsResponse = baseResponse\u003ccalendarData\u003e;\n```\n\n### getMethodsResponse\n\n```ts\ntype getMethodsResponse = baseResponse\u003cmethods\u003e;\n\ntype methods = Record\u003cstring, method\u003e;\n\ninterface method {\n    id: number;\n    name: string;\n    params: {\n        Fajr?: number;\n        Isha?: number | string;\n        Maghrib?: number | string;\n        Midnight?: string;\n        shafaq?: string;\n    };\n    location: {\n        latitude: number;\n        longitude: number;\n    };\n}\n```\n\n## Core Team\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/MuhAssar\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/2022065?v=4\" width=\"100px;\" alt=\"Netanel Basal\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMuhammad Assar\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Other libs from the author\n\nIf you enjoy working with TypeScript, we also recommend other libraries by the same author:\n\n-   [ngx-hadeethenc-api](https://github.com/WurshaApps/ngx-hadeethenc-api/) - 🕋 🚀 Angular api client for hadeethenc.com\n-   [@wursha/ngx-hadeethenc-api](https://www.npmjs.com/package/@wursha/ngx-hadeethenc-api) - npm package with built-in type declarations\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWurshaApps%2Fngx-prayertimes-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWurshaApps%2Fngx-prayertimes-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWurshaApps%2Fngx-prayertimes-api/lists"}