Get started

To start building applications with location services, you need an account and an API key.

1. Sign in with your ArcGIS account

Get a free developer account

2. Get an access token

Use an API key or OAuth 2.0 access token from your developer dashboard. Learn more in Security and authentication.

Get an API key

3. Quick start

Below is a simple example that shows the results of a request to obtain layer metadata. To access layer data:

  1. Open the code in .

  2. Replace the apiKey with your API key from the dashboard.

    CDNES ModulesNode JS
    Use dark colors for code blocks
                                                    
    Change line
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width">
      <title>ArcGIS REST JS</title>
      <style>
        body {
          font-family: monospace;
          color: white;
          overflow: auto;
          padding: 1rem;
        body,pre{
          background: #000000;
      </style>
    </head>
    <body>
      <pre id="result"></pre>
    
      <!-- require ArcGIS REST JS libraries from https://unpkg.com -->
      <script src="https://unpkg.com/@esri/arcgis-rest-request@3.0.0/dist/umd/request.umd.js"></script>
      <script src="https://unpkg.com/@esri/arcgis-rest-auth@3.0.0/dist/umd/auth.umd.js"></script>
      <script>
        /* when including ArcGIS REST JS all exports are available
        from the same arcgisRest global */
    
        const apiKey = "YOUR_API_KEY";
    
        const authentication = new arcgisRest.ApiKey({
          key: apiKey
        });
    
        arcgisRest.request("https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads_Styled/FeatureServer/0", {
          authentication
        })
          .then(response => {
            console.log(response);
            document.getElementById("result").textContent = JSON.stringify(response, null, 2);
          });
    
      </script>
    
    </body>
    </html>

    Result

4. Explore tutorials

Follow step-by-step tutorials to learn more about how to integrate ArcGIS REST JS with other location services.

See all tutorials

5. Deploy your aplication

Learn about general guidelines and the Terms of use before distributing your application.

Learn more

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.