AstronomyAPI
  • 🚀Getting Started
  • API v2 Reference
    • 🪐Bodies
      • 🌐Positions
      • 🗓️Events
    • 📸Studio
      • ✨Star Chart
      • 🌒Moon Phase
    • 🔎Search
  • 🤝Requests and Responses
    • 🪐Body Properties
    • 🕚Event Properties
    • 🔎Search Result Properties
    • 🔭Observer Parameters
    • 🗓️Tabular Responses
    • 🔢Rows Responses
    • 🚩Error Responses
    • 🔢Constellation Enums
    • 🔢DSO Enums
  • Page
  • 🧩Widgets
  • ⚠️Known Issues
  • 📕Changelog
  • Links
    • demo.astronomyapi.com
    • Sample code on Github
    • Back to Dashboard
Powered by GitBook
On this page

Was this helpful?

  1. Requests and Responses

Tabular Responses

Some endpoints return data in tabular format for easy template rendering.

Certain API endpoints might return you data in a tabular format, thus making it easier for you to render them in your template files.

You can get the table object from response object using data.table.

{
    "data": {
        "dates": {
            "from": "2016-12-20T00:00:00",
            "to": "2016-12-22T23:59:59"
        },
        "observer": {
            "location": {
                "longitude": -84.39733,
                "latitude": 33.775867,
                "elevation": 1000
            }
        },
        "table": {
            .... table object
        }
    }
}

A typical table object response will include a header and rows. The header contains the column names, while the rows contain the row data.

Each row object consists of a cells array and an entry object. The entry is the label for the current row. While cells are the values for the corresponding columns of the row.

{
    "header": [
        "Column 1",
        "Column 2"
    ],
    "rows": [
        {
            "cells": [
                {
                    .. Row 1, Col 1
                },
                {
                    .. Row 1, Col 2
                }
            ],
            "entry": {
                "id": "Row 1"
            }
        },
        {
            "cells": [
                {
                    .. Row 2, Col 1
                },
                {
                    .. Row 2, Col 2
                }
            ],
            "entry": {
                "id": "Row 2"
            }
        },
        {
            "cells": [
                {
                    .. Row 3, Col 1
                },
                {
                    .. Row 3, Col 2
                }
            ],
            "entry": {
                "id": "Row 3"
            }
        }
    ]
}
PreviousObserver ParametersNextRows Responses

Last updated 2 years ago

Was this helpful?

For more information on how to render this type of data refer to the

🤝
🗓️
samples repository