sunsetSunrise
/json
Usage and SDK Samples
curl -X GET "https://api.apieco.ir/sunrise-sunset/json?lat =&lng =&date =&callback=&formatted="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SunsetAndSunriseApi;
import java.io.File;
import java.util.*;
public class SunsetAndSunriseApiExample {
public static void main(String[] args) {
SunsetAndSunriseApi apiInstance = new SunsetAndSunriseApi();
String apiecoKey = apiecoKey_example; // String |
BigDecimal lat = 8.14; // BigDecimal | Latitude in decimal degrees. Required.
BigDecimal lng = 8.14; // BigDecimal | Longitude in decimal degrees. Required.
String date = date _example; // String | Date in YYYY-MM-DD format. Also accepts other date formats and even relative date formats. If not present, date defaults to current date. Optional.
String callback = callback_example; // String | Callback function name for JSONP response. Optional.
String formatted = formatted_example; // String | 0 or 1 (1 is default). Time values in response will be expressed following ISO 8601 and day_length will be expressed in seconds. Optional.
try {
inline_response_200 result = apiInstance.sunsetSunrise(apiecoKey, lat , lng , date , callback, formatted);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SunsetAndSunriseApi#sunsetSunrise");
e.printStackTrace();
}
}
}
import io.swagger.client.api.SunsetAndSunriseApi;
public class SunsetAndSunriseApiExample {
public static void main(String[] args) {
SunsetAndSunriseApi apiInstance = new SunsetAndSunriseApi();
String apiecoKey = apiecoKey_example; // String |
BigDecimal lat = 8.14; // BigDecimal | Latitude in decimal degrees. Required.
BigDecimal lng = 8.14; // BigDecimal | Longitude in decimal degrees. Required.
String date = date _example; // String | Date in YYYY-MM-DD format. Also accepts other date formats and even relative date formats. If not present, date defaults to current date. Optional.
String callback = callback_example; // String | Callback function name for JSONP response. Optional.
String formatted = formatted_example; // String | 0 or 1 (1 is default). Time values in response will be expressed following ISO 8601 and day_length will be expressed in seconds. Optional.
try {
inline_response_200 result = apiInstance.sunsetSunrise(apiecoKey, lat , lng , date , callback, formatted);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SunsetAndSunriseApi#sunsetSunrise");
e.printStackTrace();
}
}
}
String *apiecoKey = apiecoKey_example; //
BigDecimal *lat = 8.14; // Latitude in decimal degrees. Required.
BigDecimal *lng = 8.14; // Longitude in decimal degrees. Required.
String *date = date _example; // Date in YYYY-MM-DD format. Also accepts other date formats and even relative date formats. If not present, date defaults to current date. Optional. (optional)
String *callback = callback_example; // Callback function name for JSONP response. Optional. (optional)
String *formatted = formatted_example; // 0 or 1 (1 is default). Time values in response will be expressed following ISO 8601 and day_length will be expressed in seconds. Optional. (optional)
SunsetAndSunriseApi *apiInstance = [[SunsetAndSunriseApi alloc] init];
//
[apiInstance sunsetSunriseWith:apiecoKey
lat :lat
lng :lng
date :date
callback:callback
formatted:formatted
completionHandler: ^(inline_response_200 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var SunsetAndSunriseTimesApi = require('sunset_and_sunrise_times_api');
var api = new SunsetAndSunriseTimesApi.SunsetAndSunriseApi()
var apiecoKey = apiecoKey_example; // {String}
var lat = 8.14; // {BigDecimal} Latitude in decimal degrees. Required.
var lng = 8.14; // {BigDecimal} Longitude in decimal degrees. Required.
var opts = {
'date ': date _example, // {String} Date in YYYY-MM-DD format. Also accepts other date formats and even relative date formats. If not present, date defaults to current date. Optional.
'callback': callback_example, // {String} Callback function name for JSONP response. Optional.
'formatted': formatted_example // {String} 0 or 1 (1 is default). Time values in response will be expressed following ISO 8601 and day_length will be expressed in seconds. Optional.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.sunsetSunrise(apiecoKey, lat , lng , opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class sunsetSunriseExample
{
public void main()
{
var apiInstance = new SunsetAndSunriseApi();
var apiecoKey = apiecoKey_example; // String |
var lat = 8.14; // BigDecimal | Latitude in decimal degrees. Required.
var lng = 8.14; // BigDecimal | Longitude in decimal degrees. Required.
var date = date _example; // String | Date in YYYY-MM-DD format. Also accepts other date formats and even relative date formats. If not present, date defaults to current date. Optional. (optional)
var callback = callback_example; // String | Callback function name for JSONP response. Optional. (optional)
var formatted = formatted_example; // String | 0 or 1 (1 is default). Time values in response will be expressed following ISO 8601 and day_length will be expressed in seconds. Optional. (optional)
try
{
//
inline_response_200 result = apiInstance.sunsetSunrise(apiecoKey, lat , lng , date , callback, formatted);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling SunsetAndSunriseApi.sunsetSunrise: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\SunsetAndSunriseApi();
$apiecoKey = apiecoKey_example; // String |
$lat = 8.14; // BigDecimal | Latitude in decimal degrees. Required.
$lng = 8.14; // BigDecimal | Longitude in decimal degrees. Required.
$date = date _example; // String | Date in YYYY-MM-DD format. Also accepts other date formats and even relative date formats. If not present, date defaults to current date. Optional.
$callback = callback_example; // String | Callback function name for JSONP response. Optional.
$formatted = formatted_example; // String | 0 or 1 (1 is default). Time values in response will be expressed following ISO 8601 and day_length will be expressed in seconds. Optional.
try {
$result = $api_instance->sunsetSunrise($apiecoKey, $lat , $lng , $date , $callback, $formatted);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SunsetAndSunriseApi->sunsetSunrise: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SunsetAndSunriseApi;
my $api_instance = WWW::SwaggerClient::SunsetAndSunriseApi->new();
my $apiecoKey = apiecoKey_example; # String |
my $lat = 8.14; # BigDecimal | Latitude in decimal degrees. Required.
my $lng = 8.14; # BigDecimal | Longitude in decimal degrees. Required.
my $date = date _example; # String | Date in YYYY-MM-DD format. Also accepts other date formats and even relative date formats. If not present, date defaults to current date. Optional.
my $callback = callback_example; # String | Callback function name for JSONP response. Optional.
my $formatted = formatted_example; # String | 0 or 1 (1 is default). Time values in response will be expressed following ISO 8601 and day_length will be expressed in seconds. Optional.
eval {
my $result = $api_instance->sunsetSunrise(apiecoKey => $apiecoKey, lat => $lat , lng => $lng , date => $date , callback => $callback, formatted => $formatted);
print Dumper($result);
};
if ($@) {
warn "Exception when calling SunsetAndSunriseApi->sunsetSunrise: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.SunsetAndSunriseApi()
apiecoKey = apiecoKey_example # String |
lat = 8.14 # BigDecimal | Latitude in decimal degrees. Required.
lng = 8.14 # BigDecimal | Longitude in decimal degrees. Required.
date = date _example # String | Date in YYYY-MM-DD format. Also accepts other date formats and even relative date formats. If not present, date defaults to current date. Optional. (optional)
callback = callback_example # String | Callback function name for JSONP response. Optional. (optional)
formatted = formatted_example # String | 0 or 1 (1 is default). Time values in response will be expressed following ISO 8601 and day_length will be expressed in seconds. Optional. (optional)
try:
#
api_response = api_instance.sunset_sunrise(apiecoKey, lat , lng , date =date , callback=callback, formatted=formatted)
pprint(api_response)
except ApiException as e:
print("Exception when calling SunsetAndSunriseApi->sunsetSunrise: %s\n" % e)
Parameters
Header parameters
Name | Description |
---|---|
apieco-key* |
String
Required
|
Query parameters
Name | Description |
---|---|
lat * |
BigDecimal
Latitude in decimal degrees. Required.
Required
|
lng * |
BigDecimal
Longitude in decimal degrees. Required.
Required
|
date |
String
Date in YYYY-MM-DD format. Also accepts other date formats and even relative date formats. If not present, date defaults to current date. Optional.
|
callback |
String
Callback function name for JSONP response. Optional.
|
formatted |
String
0 or 1 (1 is default). Time values in response will be expressed following ISO 8601 and day_length will be expressed in seconds. Optional.
|