API Specification

Base URL (Data)

https://gisapi.io/api/data

API Key

Currently an API key is not required. This will not be the case forever and will be changed very soon. To obtain an API key sign up for Galileo.

Endpoints

Search Data

Endpoint: /search/:query

Method: GET

Description: Searches data in the database based on a query.

Request Parameters:

  • query (string, required): The search term to query the database.

Response:

  • Returns a JSON array of search results from the new_layer_details table.

Example Request:

GET /api/data/search/sample-query

Example Response:

[
  {
    "LAYER": "example_layer",
    "TYPE": "example_type",
    "FIELDS": "example_fields",
    "CRS": "example_crs",
    "EXTENT": "example_extent",
    "URL": "http://example.com",
    "HOSTURL": "http://hosturl.com",
    "CATEGORY": "example_category",
    "xata.createdAt": "2023-01-01T00:00:00Z",
    "xata.updatedAt": "2023-01-01T00:00:00Z"
  }
]

Advanced Search

Endpoint: /advancedsearch

Method: GET

Description: Performs an advanced search with filtering and pagination.

Query Parameters:

  • searchinput (string, required): The search term.
  • category (string, optional): Filter by category.
  • type (string, optional): Filter by type.
  • state (string, optional): Filter by state.
  • town (string, optional): Filter by town.
  • county (string, optional): Filter by county.
  • offset (number, optional): The offset for pagination.

Response:

  • Returns a JSON array of search results from the new_layer_details table based on the filters and pagination.

Example Request:

GET /api/data/advancedsearch?searchinput=sample&category=example_category&type=example_type&state=example_state&town=example_town&county=example_county&offset=100

Example Response:

[
  {
    "LAYER": "example_layer",
    "TYPE": "example_type",
    "FIELDS": "example_fields",
    "CRS": "example_crs",
    "EXTENT": "example_extent",
    "URL": "http://example.com",
    "HOSTURL": "http://hosturl.com",
    "CATEGORY": "example_category",
    "xata.createdAt": "2023-01-01T00:00:00Z",
    "xata.updatedAt": "2023-01-01T00:00:00Z"
  }
]

Source Catalog Search

Endpoint: /catalog

Method: GET

Description: Retrieves 200 sources from the source catalog based on a search query.

Query Parameters:

  • searchinput (string, required): The search term.

Response:

  • Returns a JSON array of search results from the source_catalog table.

Example Request:

GET /api/data/catalog?searchinput=sample-query

Example Response:

[
  {
    "state": "example_state",
    "county": "example_county",
    "city": "example_city",
    "url": "http://example.com",
    "owner": "example_owner"
  }
]

Get Entire Source Catalog

Endpoint: /catalog/all

Method: GET

Description: Retrieves the entire source catalog, sorted by state in ascending order.

Response:

  • Returns a JSON array of all records from the source_catalog table.

Example Request:

GET /api/data/catalog/all

Example Response:

[
  {
    "state": "example_state",
    "county": "example_county",
    "city": "example_city",
    "url": "http://example.com",
    "owner": "example_owner"
  }
]

Get Category Data

Endpoint: /category/:cat

Method: GET

Description: Retrieves data from the new_layer_details table filtered by category.

Request Parameters:

  • cat (string, required): The category to filter by.

Response:

  • Returns a paginated JSON array of data filtered by category.

Example Request:

GET /api/data/category/example_category

Example Response:

[
  {
    "LAYER": "example_layer",
    "TYPE": "example_type",
    "FIELDS": "example_fields",
    "CRS": "example_crs",
    "EXTENT": "example_extent",
    "URL": "http://example.com",
    "HOSTURL": "http://hosturl.com",
    "CATEGORY": "example_category",
    "xata.createdAt": "2023-01-01T00:00:00Z",
    "xata.updatedAt": "2023-01-01T00:00:00Z"
  }
]