Developing an application?
Integrate accurate
zmanim data into your application with our easy-to-use API.
Whether you're designing a simple shul website, building a home automation system, or suspending e-business operations for Shabbos, you'll find that developing
zmanim-powered solutions with the MyZmanim API is a breeze. Leave the algorithms to us so you can focus on your project.
Get creative.
Explore new ways to bring
zmanim and technology together. Now it's
your turn!
Have questions? Get in touch.
Starting at only $15 a month, try it now
free for 30 days.
Contact MyZmanim
What's included?
Access to
zmanim information for millions of places worldwide
Jewish calendar info including: Yom Tov, Parsha, Omer count, fast day, Daf Yomi
Automatic daylight saving time switching for most places
Updates to our data cascade automatically to your application
Looking for a developer? Contact
Bold Leopard
C#.NET
Setup
Put this code file in your project's
APP_CODE folder:
.NET Framework 4.0 (and up)
.NET Framework 3.0 (or 3.5)
.NET Framework 2.0
Usage
This most basic example illustrates how the API works:
//Declarations:
EngineClient ZmanimAPI = CreateApiInstance();
EngineParamDay Params = new EngineParamDay();
EngineResultDay Day = new EngineResultDay();
//Set parameters:
Params.User = APIUSER;
Params.Key = APIKEY;
Params.Coding = "CS";
Params.Language = "en";
Params.InputDate = DateTime.Now;
Params.LocationID = "US33487";
//Call API:
Day = ZmanimAPI.GetDay(Params);
//Display results:
Console.WriteLine(Day.Place.Name);
Console.WriteLine(Day.Time.Weekday);
Console.WriteLine("Latest Shema at:");
Console.WriteLine(Day.Zman.ShemaGra.ToString("t"));
//Use results for further calculations:
Console.WriteLine("Mincha Minyan 20 min before shekiah at:");
Console.WriteLine(Day.Zman.SunsetDefault.AddMinutes(-20).ToString("t"));
Example
Download this
working example in C# and adapt it as needed.
VB.NET
Setup
Put this code file in your project's
APP_CODE folder:
.NET Framework 4.0 (and up)
.NET Framework 3.0 (or 3.5)
.NET Framework 2.0
Usage
This most basic example illustrates how the API works:
'Declarations:'
Dim ZmanimAPI As EngineClient = CreateApiInstance()
Dim Params As New EngineParamDay
Dim Day As New EngineResultDay
'Set parameters:'
Params.User = APIUSER
Params.Key = APIKEY
Params.Coding = "VB"
Params.Language = "en"
Params.InputDate = DateTime.Now()
Params.LocationID = "US33487"
'Call API:'
Day = ZmanimAPI.GetDay(Params)
'Display results:'
Console.WriteLine(Day.Place.Name)
Console.WriteLine(Day.Time.Weekday)
Console.WriteLine("Latest Shema at:")
Console.WriteLine(Day.Zman.ShemaGra.ToString("t"))
'Use results for further calculations:'
Console.WriteLine("Mincha Minyan 20 min before shekiah at:")
Console.WriteLine(Day.Zman.SunsetDefault.AddMinutes(-20).ToString("t"))
Example
Download this
working example in VB and adapt it as needed.
PHP
Usage
This most basic example illustrates how the JSON API works:
//Prepare parameters:
$params = "user=" . $APIUSER .
"&key=" . $APIKEY .
"&coding=PHP" .
"&language=en" .
"&locationID=US33487" .
"&inputDate=" . date("Y-m-d");
//Call API:
$response = CallApi("getDay", $params);
//Process response:
$time = $response->Time;
$place = $response->Place;
$zman = $response->Zman;
//Display results:
echo $place->Name;
echo $time->Weekday;
echo "Latest Shema at:";
echo formatZman($zman->ShemaGra);
//Use results for further calculations:
echo "Mincha Minyan 20 min before shekiah at:";
echo date("g:i a", strtotime($zman->SunsetDefault) - (20*60));
//Convert date value to a string:
function formatZman($aZman){
return date("g:i a", strtotime($aZman));
}
Example
Download this
working example in PHP and adapt it as needed.
JavaScript
Usage
This most basic example illustrates how the API works:
//Prepare parameters
var param = "coding=JS&language=en&locationid=" + locationid
+ "&inputdate=" + formatDate(new Date())
+ "&key=" + APIKEY
+ "&user=" + APIUSER;
//Call API:
callApi(url, param, callback);
//Process response and display results:
function callback(response) {
var day = JSON.parse(response);
document.write(day.Place.Name);
document.write(day.Time.Weekday);
document.write("Latest Shema at: ");
document.write(formatZman(day.Zman.ShemaGra));
document.write("Mincha Minyan 20 min before shekiah at: ");
document.write(formatZman(addMinutes(day.Zman.SunsetDefault, -20)));
}
Example
Download this
working example in JavaScript and adapt it as needed.
Please note: The API may not be called from client-side Javascript such that your API key is exposed to end users.
Android
Setup
Include
these Java classes and jar files in your Android project as follows:
- In your Android project, create a new package folder and name it: com.myzmanim.engine
- Copy all files from the enclosed src folder to the new package folder created above.
- The enclosed libs folder contains all the jar files required by the classes. Copy all the jar files to your Android project and add references to them (every IDE has different way of adding references to external jars).
Usage
This most basic example illustrates how the API works:
//Declarations:
MZBasicHttpBinding_IEngine ZmanimAPI = new MZBasicHttpBinding_IEngine();
MZEngine_x002E_ParamDay Params = new MZEngine_x002E_ParamDay();
MZEngine_x002E_ResultDay Day = new MZEngine_x002E_ResultDay();
//Set parameters:
Params.User = APIUSER;
Params.Key = APIKEY;
Params.Coding = "Java";
Params.Language = "en";
Params.InputDate = new Date();
Params.LocationID = "US33487";
//Call API: (You may use GetDay or GetDayAsync)
Day = ZmanimAPI.GetDay(Params);
//Display results:
System.out.println(Day.Place.Name);
System.out.println(Day.Time.Weekday);
System.out.println("Latest Shema at:");
System.out.println(formatZman(Day.Zman.ShemaGra));
//Convert date value to a string:
public static String formatZman(Date zman) {
SimpleDateFormat sdf = new SimpleDateFormat("hh:mm a");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
return sdf.format(zman);
}
Example
Download this
working example for Android and adapt it as needed.
iOS
Setup
Include
these Objective-C classes in your iOS project as follows:
- Copy all files from the enclosed src folder to your iOS project. (It is recommended that you create a separate group for these files in your XCode project.)
- Copy all files from the enclosed KissXML folder to your iOS project. When prompted with choose options for adding these files do this:
- For added folders choose create groups
- Copy items if needed should be checked
- Open edit project settings, go to the build settings tab and do this:
- In the linking section, go to the other linker flags and add the value: -lxml2
- In the search paths section add a new search path to the header search paths for /usr/include/libxml2 (This is needed by the KissXML library)
Usage
This most basic example illustrates how the API works:
//Declarations:
MZBasicHttpBinding_IEngine* zmanimAPI =
[[MZBasicHttpBinding_IEngine alloc]init];
MZEngine_x002E_ParamDay* dayParams =
[[MZEngine_x002E_ParamDay alloc]init];
MZEngine_x002E_ResultDay* dayResult =
[[MZEngine_x002E_ResultDay alloc]init];
//Set parameters:
dayParams.User = APIUSER;
dayParams.Key = APIKEY;
dayParams.Coding = @"ObjC";
dayParams.Language = @"en";
dayParams.InputDate = [NSDate date];
dayParams.LocationID = @"US33487";
//Call API: (You may use GetDay or GetDayAsync)
dayResult = [zmanimAPI GetDay:dayParams __error:nil];
//Display results:
NSLog(@"%@", dayResult.Place.Name);
NSLog(@"%@", dayResult.Time.Weekday);
NSLog(@"Latest Shema at:");
NSLog(@"%@", [self formatZman:dayResult.Zman.ShemaGra]);
//Convert date value to a string:
- (NSString*)formatZman:(NSDate*)zman
{
NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
[formatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
[formatter setDateFormat:@"h:mm a"];
return [formatter stringFromDate:zman];
}
Example
Download this
working example for iOS and adapt it as needed.
REST / SOAP
Use our API in your prefered language even if it's not listed here. Connect via REST (Representational State Transfer) or SOAP (Simple Object Access Protocol).
REST
Service endpoint:
https://api.myzmanim.com/engine1.json.aspx
SOAP
Service endpoint:
https://api.myzmanim.com/engine1.svc
Method definitions:
WSDL XML Document