Skip to content

Style - GET ​

Resource URL ​

https://www.mapquestapi.com/styles/v1/{style}

Resource Information ​

Response Formatapplication/json (MapLibre GL style document)
AuthenticationYes (Requires Key)
Rate LimitedNo (non-billable — see Billing)

URL Structure ​

The style URL is made up of a version segment and a style name:

/styles/v1/{style}

You supply the {style} theme you want (light or dark). The returned style document is a complete MapLibre GL style — it already references the vector tile source, sprites, and glyphs, so your mapping library can render a full basemap with no additional setup.

What the Map Shows ​

The light and dark styles are general-purpose vector basemaps. Both render the same map features, styled for a light or dark theme:

  • Roads — highways, streets, and paths, with road labels and route shields
  • Place labels — countries, states, cities, neighborhoods, and other named places
  • Points of interest — labels for select places such as parks, airports, universities, and hospitals, shown as you zoom in
  • Boundaries — country, state, and other administrative borders
  • Water — oceans, lakes, and rivers, with their labels
  • Land use — parks, forests, and other land-cover areas
  • Buildings — building footprints at higher zoom levels
  • Terrain — hillshade relief

Labels are rendered in the map's default language. Because the styles are vector, every feature scales crisply at any zoom and can be restyled at runtime with MapLibre GL.

Request Parameters ​

ParameterDescriptionRequired
keyThe API Key, which is needed to make requests to MapQuest services. The key is also embedded into the vector tile URLs inside the returned style, so the map's tiles are fetched with the same key.Yes

Path Parameters ​

ParameterDescriptionRequired
styleThe map style theme to return. One of: light, dark. Any other value returns 404.

Example:
light
Yes

Response ​

The response is a standard MapLibre GL style document (application/json) describing the sources, layers, sprites, and glyphs for a MapQuest vector basemap:

json
{
  "version": 8,
  "name": "MapQuest Light",
  "sources": {
    "omv": {
      "type": "vector",
      "tiles": ["https://www.mapquestapi.com/tiles/v1/vector/{z}/{x}/{y}?key=KEY"],
      "maxzoom": 17
    }
  },
  "layers": [ ... ]
}

The vector source's tiles URL carries the same key you used to request the style, so the map's tiles load without any further configuration. The {z}/{x}/{y} placeholders are left intact for your mapping library to fill in as the user pans and zooms. Because the response embeds your key, treat each style document as specific to your account.

Error Responses ​

Errors are returned as application/problem+json.

StatusDescription
400The key query parameter is missing.
404The requested {style} is not a valid style. Valid styles are light and dark.

Billing ​

Requests to the Styles API are not billed — fetching a style document is free.

You are billed for the map tiles that the style loads. When your mapping library renders the map, it continuously requests tiles as the user pans and zooms, and those tile requests count toward your usage. Tiles are billed at a rate of 10 tile requests per 1 MapQuest transaction.

Using the Styles API with Mapping Libraries ​

The Styles API returns a ready-to-use MapLibre GL style, so most vector-capable mapping libraries can render it by pointing their style option at the URL. Unlike the Tiles API, there is no raster source or layer to configure — the single style URL does all the work.

MapLibre GL JS ​

Pass the style URL directly as the map's style. MapLibre loads the vector tiles, sprites, and fonts for you.

js
const map = new maplibregl.Map({
  container: 'map',
  style: 'https://www.mapquestapi.com/styles/v1/light?key=KEY',
  center: [-76.307078, 40.039401],
  zoom: 12
});

Swap light for dark in the URL to load the dark theme instead.

Switching Themes at Runtime ​

To toggle between the light and dark themes after the map has loaded, call setStyle with the other style URL.

js
// switch to the dark theme
map.setStyle('https://www.mapquestapi.com/styles/v1/dark?key=KEY');

OpenLayers ​

Use ol-mapbox-style to apply the style to an OpenLayers map. Its apply helper reads the MapLibre style document and configures the layers for you.

js
import { apply } from 'ol-mapbox-style';

apply('map', 'https://www.mapquestapi.com/styles/v1/light?key=KEY');

The apply helper creates and returns the map, wiring up the vector source and layers from the style document.

Example Requests ​

Example Request: Light Style ​

GET https://www.mapquestapi.com/styles/v1/light?key=KEY

Example Request: Dark Style ​

GET https://www.mapquestapi.com/styles/v1/dark?key=KEY

More Resources ​