positions
This endpoint will return the position of Solar System bodies for a given range of dates, for the given Earth coordinates.
/positions/{planet}
Usage and SDK Samples
curl -X POST -H "apieco-key: [[apiKey]]" "https://api.apieco.ir/astronomy/positions/{planet}?planet=&to_month=&lat=&lon=&from_month=&from_year=&to_year=&from_day=&to_day="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PositionsApi;
import java.io.File;
import java.util.*;
public class PositionsApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: apieco-key
ApiKeyAuth apieco-key = (ApiKeyAuth) defaultClient.getAuthentication("apieco-key");
apieco-key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apieco-key.setApiKeyPrefix("Token");
PositionsApi apiInstance = new PositionsApi();
String apiecoKey = apiecoKey_example; // String |
String planet = planet_example; // String |
String planet2 = planet_example; // String |
BigDecimal toMonth = 8.14; // BigDecimal |
BigDecimal lat = 8.14; // BigDecimal |
BigDecimal lon = 8.14; // BigDecimal |
BigDecimal fromMonth = 8.14; // BigDecimal |
BigDecimal fromYear = 8.14; // BigDecimal |
BigDecimal toYear = 8.14; // BigDecimal |
BigDecimal fromDay = 8.14; // BigDecimal |
BigDecimal toDay = 8.14; // BigDecimal |
try {
inline_response_200 result = apiInstance.positions(apiecoKey, planet, planet2, toMonth, lat, lon, fromMonth, fromYear, toYear, fromDay, toDay);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PositionsApi#positions");
e.printStackTrace();
}
}
}
import io.swagger.client.api.PositionsApi;
public class PositionsApiExample {
public static void main(String[] args) {
PositionsApi apiInstance = new PositionsApi();
String apiecoKey = apiecoKey_example; // String |
String planet = planet_example; // String |
String planet2 = planet_example; // String |
BigDecimal toMonth = 8.14; // BigDecimal |
BigDecimal lat = 8.14; // BigDecimal |
BigDecimal lon = 8.14; // BigDecimal |
BigDecimal fromMonth = 8.14; // BigDecimal |
BigDecimal fromYear = 8.14; // BigDecimal |
BigDecimal toYear = 8.14; // BigDecimal |
BigDecimal fromDay = 8.14; // BigDecimal |
BigDecimal toDay = 8.14; // BigDecimal |
try {
inline_response_200 result = apiInstance.positions(apiecoKey, planet, planet2, toMonth, lat, lon, fromMonth, fromYear, toYear, fromDay, toDay);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PositionsApi#positions");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: apieco-key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"apieco-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"apieco-key"];
String *apiecoKey = apiecoKey_example; //
String *planet = planet_example; //
String *planet2 = planet_example; //
BigDecimal *toMonth = 8.14; //
BigDecimal *lat = 8.14; //
BigDecimal *lon = 8.14; //
BigDecimal *fromMonth = 8.14; //
BigDecimal *fromYear = 8.14; //
BigDecimal *toYear = 8.14; //
BigDecimal *fromDay = 8.14; //
BigDecimal *toDay = 8.14; // (optional)
PositionsApi *apiInstance = [[PositionsApi alloc] init];
[apiInstance positionsWith:apiecoKey
planet:planet
planet2:planet2
toMonth:toMonth
lat:lat
lon:lon
fromMonth:fromMonth
fromYear:fromYear
toYear:toYear
fromDay:fromDay
toDay:toDay
completionHandler: ^(inline_response_200 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var AstronomyApi_ = require('astronomy_api_');
var defaultClient = AstronomyApi_.ApiClient.instance;
// Configure API key authorization: apieco-key
var apieco-key = defaultClient.authentications['apieco-key'];
apieco-key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apieco-key.apiKeyPrefix['apieco-key'] = "Token"
var api = new AstronomyApi_.PositionsApi()
var apiecoKey = apiecoKey_example; // {String}
var planet = planet_example; // {String}
var planet2 = planet_example; // {String}
var toMonth = 8.14; // {BigDecimal}
var lat = 8.14; // {BigDecimal}
var lon = 8.14; // {BigDecimal}
var fromMonth = 8.14; // {BigDecimal}
var fromYear = 8.14; // {BigDecimal}
var toYear = 8.14; // {BigDecimal}
var fromDay = 8.14; // {BigDecimal}
var opts = {
'toDay': 8.14 // {BigDecimal}
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.positions(apiecoKey, planet, planet2, toMonth, lat, lon, fromMonth, fromYear, toYear, fromDay, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class positionsExample
{
public void main()
{
// Configure API key authorization: apieco-key
Configuration.Default.ApiKey.Add("apieco-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("apieco-key", "Bearer");
var apiInstance = new PositionsApi();
var apiecoKey = apiecoKey_example; // String |
var planet = planet_example; // String |
var planet2 = planet_example; // String |
var toMonth = 8.14; // BigDecimal |
var lat = 8.14; // BigDecimal |
var lon = 8.14; // BigDecimal |
var fromMonth = 8.14; // BigDecimal |
var fromYear = 8.14; // BigDecimal |
var toYear = 8.14; // BigDecimal |
var fromDay = 8.14; // BigDecimal |
var toDay = 8.14; // BigDecimal | (optional)
try
{
inline_response_200 result = apiInstance.positions(apiecoKey, planet, planet2, toMonth, lat, lon, fromMonth, fromYear, toYear, fromDay, toDay);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling PositionsApi.positions: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apieco-key
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('apieco-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apieco-key', 'Bearer');
$api_instance = new Swagger\Client\Api\PositionsApi();
$apiecoKey = apiecoKey_example; // String |
$planet = planet_example; // String |
$planet2 = planet_example; // String |
$toMonth = 8.14; // BigDecimal |
$lat = 8.14; // BigDecimal |
$lon = 8.14; // BigDecimal |
$fromMonth = 8.14; // BigDecimal |
$fromYear = 8.14; // BigDecimal |
$toYear = 8.14; // BigDecimal |
$fromDay = 8.14; // BigDecimal |
$toDay = 8.14; // BigDecimal |
try {
$result = $api_instance->positions($apiecoKey, $planet, $planet2, $toMonth, $lat, $lon, $fromMonth, $fromYear, $toYear, $fromDay, $toDay);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PositionsApi->positions: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PositionsApi;
# Configure API key authorization: apieco-key
$WWW::SwaggerClient::Configuration::api_key->{'apieco-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'apieco-key'} = "Bearer";
my $api_instance = WWW::SwaggerClient::PositionsApi->new();
my $apiecoKey = apiecoKey_example; # String |
my $planet = planet_example; # String |
my $planet2 = planet_example; # String |
my $toMonth = 8.14; # BigDecimal |
my $lat = 8.14; # BigDecimal |
my $lon = 8.14; # BigDecimal |
my $fromMonth = 8.14; # BigDecimal |
my $fromYear = 8.14; # BigDecimal |
my $toYear = 8.14; # BigDecimal |
my $fromDay = 8.14; # BigDecimal |
my $toDay = 8.14; # BigDecimal |
eval {
my $result = $api_instance->positions(apiecoKey => $apiecoKey, planet => $planet, planet2 => $planet2, toMonth => $toMonth, lat => $lat, lon => $lon, fromMonth => $fromMonth, fromYear => $fromYear, toYear => $toYear, fromDay => $fromDay, toDay => $toDay);
print Dumper($result);
};
if ($@) {
warn "Exception when calling PositionsApi->positions: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: apieco-key
swagger_client.configuration.api_key['apieco-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['apieco-key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.PositionsApi()
apiecoKey = apiecoKey_example # String |
planet = planet_example # String |
planet2 = planet_example # String |
toMonth = 8.14 # BigDecimal |
lat = 8.14 # BigDecimal |
lon = 8.14 # BigDecimal |
fromMonth = 8.14 # BigDecimal |
fromYear = 8.14 # BigDecimal |
toYear = 8.14 # BigDecimal |
fromDay = 8.14 # BigDecimal |
toDay = 8.14 # BigDecimal | (optional)
try:
api_response = api_instance.positions(apiecoKey, planet, planet2, toMonth, lat, lon, fromMonth, fromYear, toYear, fromDay, toDay=toDay)
pprint(api_response)
except ApiException as e:
print("Exception when calling PositionsApi->positions: %s\n" % e)
Parameters
Path parameters
Name | Description |
---|---|
planet* |
String
Required
|
Header parameters
Name | Description |
---|---|
apieco-key* |
String
Required
|
Query parameters
Name | Description |
---|---|
planet* |
String
Required
|
to_month* |
BigDecimal
Required
|
lat* |
BigDecimal
Required
|
lon* |
BigDecimal
Required
|
from_month* |
BigDecimal
Required
|
from_year* |
BigDecimal
Required
|
to_year* |
BigDecimal
Required
|
from_day* |
BigDecimal
Required
|
to_day |
BigDecimal
|