> For the complete documentation index, see [llms.txt](https://quantaapi.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://quantaapi.gitbook.io/docs/geo-api/planets-rise-set.md).

# Planets Rise-Set

Get the rise and set times of a planet — similar to sunrise and sunset — for any location on Earth.

### 🧾 Overview – Find When a Planet is Visible

This API tells you the exact time a planet will rise above the horizon and set below it for a given date and location. Think of it like sunrise/sunset, but for other planets like Moon, Venus, Mars, Jupiter, etc.

It’s useful for:

* Astronomy apps
* Night sky viewing tools
* Planet visibility trackers

## 🚀 How to Get Planets Rise-Set

To get Planets Rise-Set, make a POST request to the following endpoint:

<kbd><mark style="color:green;">POST<mark style="color:green;"></kbd><kbd><https://geo.quantaapi.com/api/v1/planets/{planet}/rise-set></kbd>

<kbd><mark style="color:green;">POST<mark style="color:green;"></kbd><kbd><https://geo.quantaapi.com/api/v1/planets/sun/rise-set></kbd>

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name  | Type  | Example    | Description                       |
| ----- | ----- | ---------- | --------------------------------- |
| date  | Date  | 2025-04-12 | search by date                    |
| lat   | Float | 28.6138954 | Place Latitude                    |
| lon   | Float | 77.2090057 | Place Longitude                   |
| tzone | Float | 5.5        | Place timezone for the given date |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "status": "success",
    "message": "Sun rise and set fetched successfully.",
    "code": 200,
    "type": "SUCCESS",
    "data": {
        "planet": "sun",
        "date": "2025-12-30",
        "rise": "2025-12-30 06:40:01",
        "set": "2025-12-30 17:16:11",
        "message": "The rise and set times are calculated based on the sunrise rule."
    },
    "input": {
        "lat": "25.0422777",
        "lon": "83.6078512",
        "tzone": "5.5"
    },
    "info": {
        "timestamp_utc": "2025-06-07 13:01:01",
        "version": "v1.0",
        "credits_used": 1,
        "response_time": 27.98
    }
}
```

{% endtab %}

{% tab title="401" %}

```json
{
    "status": "error",
    "message": "The provided authorization token is invalid or expired",
    "code": 401,
    "type": "AUTHORIZATION_INVALID"
}
```

{% endtab %}

{% tab title="422" %}

```json
{
    "status": "error",
    "message": "Validation Error",
    "code": 422,
    "type": "VALIDATION_ERROR",
    "errors": {
        "date": [
            "The date field is required."
        ],
        "lat": [
            "Latitude is required."
        ],
        "lon": [
            "Longitude is required."
        ],
        "tzone": [
            "Timezone is required."
        ]
    }
}
```

{% endtab %}
{% endtabs %}
