> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.megamation.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.megamation.com/_mcp/server.

# Get buildings

GET https://api.megamation.com/CLIENT_ID/DATABASE_ID/Building

An example of getting building information using search criteria

Reference: https://apidocs.megamation.com/api/building/get-building-get-buildings

## Authentication

- `Authorization` header (basic auth, required) — Basic authentication of the form `Basic <base64(username:password)>`.
- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `CLASS` (string, optional)

## Response

### 200

OK

## Examples

**Response**

```json
{
  "_embedded": {
    "Building": [
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/VH"
          }
        },
        "address": "",
        "building": "VH",
        "building_name": "VALVE HOUSE",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD2"
          }
        },
        "address": "",
        "building": "BD2",
        "building_name": "Sciences",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD15"
          }
        },
        "address": "",
        "building": "BD15",
        "building_name": "Electronics",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD17"
          }
        },
        "address": "",
        "building": "BD17",
        "building_name": "Forum",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/FT"
          }
        },
        "address": "",
        "building": "FT",
        "building_name": "Flight Technology",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BL-CORE"
          }
        },
        "address": "",
        "building": "BL-CORE",
        "building_name": "Core  Wing",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-0750"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "001-0750",
        "building_name": "Smithey Science",
        "class": "BUILDING",
        "floors": "4"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-0800"
          }
        },
        "address": "5429 Main St� Williamsville, NY 14221",
        "building": "001-0800",
        "building_name": "Band Choral Orchestra",
        "class": "BUILDING",
        "floors": "1"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-1100"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "001-1100",
        "building_name": "Bales Gym",
        "class": "BUILDING",
        "floors": "1"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-1500"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "001-1500",
        "building_name": "Speech,Debate Theatre",
        "class": "BUILDING",
        "floors": "1"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-2200"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "001-2200",
        "building_name": "ROTC",
        "class": "BUILDING",
        "floors": "3"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-2400"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "001-2400",
        "building_name": "CT Library",
        "class": "BUILDING",
        "floors": "2"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-0400"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "001-0400",
        "building_name": "English Building",
        "class": "BUILDING",
        "floors": "5"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-0200"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "001-0200",
        "building_name": "Other Lang Building",
        "class": "BUILDING",
        "floors": "2"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD3"
          }
        },
        "address": "",
        "building": "BD3",
        "building_name": "Administration",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD5"
          }
        },
        "address": "",
        "building": "BD5",
        "building_name": "Physical Education",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD7"
          }
        },
        "address": "",
        "building": "BD7",
        "building_name": "Campus Services",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD9"
          }
        },
        "address": "",
        "building": "BD9",
        "building_name": "Auto / Diesel",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD12"
          }
        },
        "address": "",
        "building": "BD12",
        "building_name": "Manufacturing / Auto Body / RV",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD10"
          }
        },
        "address": "405 South Main Street�Salt Lake City,\tUT�84111",
        "building": "BD10",
        "building_name": "Aviation",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-0100"
          }
        },
        "address": "5500 Main St�Williamsville, NY 14221",
        "building": "001-0100",
        "building_name": "Math Building",
        "class": "BUILDING",
        "floors": "3"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-1400"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "001-1400",
        "building_name": "South Campus",
        "class": "BUILDING",
        "floors": "6"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-2500"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "001-2500",
        "building_name": "Field House 2002",
        "class": "BUILDING",
        "floors": "1"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-0700"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "001-0700",
        "building_name": "Helton Science",
        "class": "BUILDING",
        "floors": "5"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD8"
          }
        },
        "address": "",
        "building": "BD8",
        "building_name": "Welding",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD00"
          }
        },
        "address": "4000 East 30th Avenue�Eugene, OR�97405",
        "building": "BD00",
        "building_name": "Center Building",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD6"
          }
        },
        "address": "",
        "building": "BD6",
        "building_name": "Performing Arts",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/MULN"
          }
        },
        "address": "365 N McILroy Ave�Fayetteville AR�72701",
        "building": "MULN",
        "building_name": "David W Mullins Library",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD1"
          }
        },
        "address": "4000 East 30th Avenue �Eugene, Oregon 97405 ",
        "building": "BD1",
        "building_name": "Arts Building",
        "class": "BUILDING",
        "floors": "4"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/SCTBLDG"
          }
        },
        "address": "",
        "building": "SCTBLDG",
        "building_name": "Southend Container Terminal Buildings",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/1001-0900"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "1001-0900",
        "building_name": "Athletics Building",
        "class": "BUILDING",
        "floors": "3"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BL"
          }
        },
        "address": "2820 Sweet Home Rd�Buffalo NY�14228",
        "building": "BL",
        "building_name": "Lodge Building",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/SM"
          }
        },
        "address": "",
        "building": "SM",
        "building_name": "Service and Maintenance Building",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD4"
          }
        },
        "address": "",
        "building": "BD4",
        "building_name": "Health",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BL-A"
          }
        },
        "address": "",
        "building": "BL-A",
        "building_name": "A Wing",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/ADMN"
          }
        },
        "address": "1125 W. Maple St.�Fayetteville, AR�72701�",
        "building": "ADMN",
        "building_name": "Administrative Building",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-BJTHEA"
          }
        },
        "address": "5429 Main St�Williamsville, NY 14221",
        "building": "001-BJTHEA",
        "building_name": "Burdine Johnson Theater",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-0350"
          }
        },
        "address": "5429 Main St � Williamsville, NY 14221",
        "building": "001-0350",
        "building_name": "North Gym",
        "class": "BUILDING",
        "floors": "1"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-1300"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "001-1300",
        "building_name": "PEP",
        "class": "BUILDING",
        "floors": "1"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD16"
          }
        },
        "address": "",
        "building": "BD16",
        "building_name": "Math / Science",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-0900"
          }
        },
        "address": "",
        "building": "001-0900",
        "building_name": "Athletics",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-1600"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "001-1600",
        "building_name": "Little Theatre",
        "class": "BUILDING",
        "floors": "2"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-0300"
          }
        },
        "address": "3100 Main St�Williamsville NY ",
        "building": "001-0300",
        "building_name": "Eng Special Programs",
        "class": "BUILDING",
        "floors": "1"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-1000"
          }
        },
        "address": "4100 Main St�Williamsville, NY 14221�",
        "building": "001-1000",
        "building_name": "Administration Building",
        "class": "BUILDING",
        "floors": "4"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/001-01000"
          }
        },
        "address": "5500 Main St�Williamsville, NY 14221",
        "building": "001-01000",
        "building_name": "Math Building",
        "class": "BUILDING",
        "floors": "3"
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/BD11"
          }
        },
        "address": "",
        "building": "BD11",
        "building_name": "ART / ESL / GED",
        "class": "BUILDING",
        "floors": ""
      },
      {
        "_links": {
          "self": {
            "href": "https://api.megamation.com/mpcdev/dl/Building/FC"
          }
        },
        "address": "",
        "building": "FC",
        "building_name": "Florence Center",
        "class": "BUILDING",
        "floors": ""
      }
    ]
  },
  "_links": {
    "apiEntryPoint": {
      "href": "https://api.megamation.com/mpcdev/dl"
    },
    "self": {
      "href": "https://api.megamation.com/mpcdev/dl/Building?CLASS=BUILDING"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.megamation.com/CLIENT_ID/DATABASE_ID/Building"

querystring = {"CLASS":"BUILDING"}

response = requests.get(url, params=querystring, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://api.megamation.com/CLIENT_ID/DATABASE_ID/Building?CLASS=BUILDING';
const credentials = btoa("<username>:<password>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megamation.com/CLIENT_ID/DATABASE_ID/Building?CLASS=BUILDING"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<username>", "<password>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.megamation.com/CLIENT_ID/DATABASE_ID/Building?CLASS=BUILDING")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<username>", "<password>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.megamation.com/CLIENT_ID/DATABASE_ID/Building?CLASS=BUILDING")
  .basicAuth("<username>", "<password>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.megamation.com/CLIENT_ID/DATABASE_ID/Building?CLASS=BUILDING', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.megamation.com/CLIENT_ID/DATABASE_ID/Building?CLASS=BUILDING");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megamation.com/CLIENT_ID/DATABASE_ID/Building?CLASS=BUILDING")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```