Minor Planet Center API

Asteroids

asteroids

MPC results are parsed per the orbit format specified here. In some cases, a field may not be present in the results if it was not present in MPCORB.dat.


/api/mpc

Usage and SDK Samples

curl -X GET "https://api.apieco.ir/minor-planet/api/mpc?limit=&query="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AsteroidsApi;

import java.io.File;
import java.util.*;

public class AsteroidsApiExample {

    public static void main(String[] args) {
        
        AsteroidsApi apiInstance = new AsteroidsApi();
        String apiecoKey = apiecoKey_example; // String | 
        String limit = limit_example; // String | 
        String query = query_example; // String | takes a JSON object that uses the MongoDB query language. Specifically, it can be treated like a find() operation.
For example, let's build a request that returns 10 asteroids with roughly circular orbits, low inclination, and semi-major axis less than 1.5 AU.
        try {
            array[inline_response_200] result = apiInstance.asteroids(apiecoKey, limit, query);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AsteroidsApi#asteroids");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.AsteroidsApi;

public class AsteroidsApiExample {

    public static void main(String[] args) {
        AsteroidsApi apiInstance = new AsteroidsApi();
        String apiecoKey = apiecoKey_example; // String | 
        String limit = limit_example; // String | 
        String query = query_example; // String | takes a JSON object that uses the MongoDB query language. Specifically, it can be treated like a find() operation.
For example, let's build a request that returns 10 asteroids with roughly circular orbits, low inclination, and semi-major axis less than 1.5 AU.
        try {
            array[inline_response_200] result = apiInstance.asteroids(apiecoKey, limit, query);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AsteroidsApi#asteroids");
            e.printStackTrace();
        }
    }
}
String *apiecoKey = apiecoKey_example; // 
String *limit = limit_example; //  (optional)
String *query = query_example; // takes a JSON object that uses the MongoDB query language. Specifically, it can be treated like a find() operation.
For example, let's build a request that returns 10 asteroids with roughly circular orbits, low inclination, and semi-major axis less than 1.5 AU. (optional)

AsteroidsApi *apiInstance = [[AsteroidsApi alloc] init];

// MPC results are parsed per the orbit format specified here. In some cases, a field may not be present in the results if it was not present in MPCORB.dat.
[apiInstance asteroidsWith:apiecoKey
    limit:limit
    query:query
              completionHandler: ^(array[inline_response_200] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var MinorPlanetCenterApi = require('minor_planet_center_api');

var api = new MinorPlanetCenterApi.AsteroidsApi()

var apiecoKey = apiecoKey_example; // {String} 

var opts = { 
  'limit': limit_example, // {String} 
  'query': query_example // {String} takes a JSON object that uses the MongoDB query language. Specifically, it can be treated like a find() operation.
For example, let's build a request that returns 10 asteroids with roughly circular orbits, low inclination, and semi-major axis less than 1.5 AU.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.asteroids(apiecoKey, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class asteroidsExample
    {
        public void main()
        {
            
            var apiInstance = new AsteroidsApi();
            var apiecoKey = apiecoKey_example;  // String | 
            var limit = limit_example;  // String |  (optional) 
            var query = query_example;  // String | takes a JSON object that uses the MongoDB query language. Specifically, it can be treated like a find() operation.
For example, let's build a request that returns 10 asteroids with roughly circular orbits, low inclination, and semi-major axis less than 1.5 AU. (optional) 

            try
            {
                // MPC results are parsed per the orbit format specified here. In some cases, a field may not be present in the results if it was not present in MPCORB.dat.
                array[inline_response_200] result = apiInstance.asteroids(apiecoKey, limit, query);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling AsteroidsApi.asteroids: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\AsteroidsApi();
$apiecoKey = apiecoKey_example; // String | 
$limit = limit_example; // String | 
$query = query_example; // String | takes a JSON object that uses the MongoDB query language. Specifically, it can be treated like a find() operation.
For example, let's build a request that returns 10 asteroids with roughly circular orbits, low inclination, and semi-major axis less than 1.5 AU.

try {
    $result = $api_instance->asteroids($apiecoKey, $limit, $query);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AsteroidsApi->asteroids: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::AsteroidsApi;

my $api_instance = WWW::SwaggerClient::AsteroidsApi->new();
my $apiecoKey = apiecoKey_example; # String | 
my $limit = limit_example; # String | 
my $query = query_example; # String | takes a JSON object that uses the MongoDB query language. Specifically, it can be treated like a find() operation.
For example, let's build a request that returns 10 asteroids with roughly circular orbits, low inclination, and semi-major axis less than 1.5 AU.

eval { 
    my $result = $api_instance->asteroids(apiecoKey => $apiecoKey, limit => $limit, query => $query);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling AsteroidsApi->asteroids: $@\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.AsteroidsApi()
apiecoKey = apiecoKey_example # String | 
limit = limit_example # String |  (optional)
query = query_example # String | takes a JSON object that uses the MongoDB query language. Specifically, it can be treated like a find() operation.
For example, let's build a request that returns 10 asteroids with roughly circular orbits, low inclination, and semi-major axis less than 1.5 AU. (optional)

try: 
    # MPC results are parsed per the orbit format specified here. In some cases, a field may not be present in the results if it was not present in MPCORB.dat.
    api_response = api_instance.asteroids(apiecoKey, limit=limit, query=query)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling AsteroidsApi->asteroids: %s\n" % e)

Parameters

Header parameters
Name Description
apieco-key*
String
Required
Query parameters
Name Description
limit
String
query
String
takes a JSON object that uses the MongoDB query language. Specifically, it can be treated like a find() operation. For example, let's build a request that returns 10 asteroids with roughly circular orbits, low inclination, and semi-major axis less than 1.5 AU.

Responses

Status: 200 - successful