---
title: "Fetch dictionary data with the JSS REST Dictionary Service"
slug: "fetch-dictionary-data-with-the-jss-rest-dictionary-service"
abstract: "Example of how to fetch Sitecore dictionary data with the JSS REST Dictionary Service."
---
# Fetch dictionary data with the JSS REST Dictionary Service

To invoke the REST Dictionary Service from a JSS application, use the JSS `RestDictionaryService`:

> [!note]
> This example assumes you create the files in the `/src` directory of the project, and that you have a `config.js` file or `config.ts` file in the `/src/temp` directory. Adjust the import statements as necessary to reflect your project's setup.

To fetch dictionary data with the JSS REST Dictionary Service:

1. In a new `dictionary-service.ts` file, create an instance of the `RestDictionaryService` class and provide the configuration object:

    ```csharp
    import { RestDictionaryService } from '@sitecore-jss/sitecore-jss';
    import config from 'temp/config';

    export const dictionaryService = new RestDictionaryService({
      apiHost: config.sitecoreApiHost,
      apiKey: config.sitecoreApiKey,
      siteName: config.jssAppName,
    });
    ```

2. In the file where you want to fetch the data, import and use your new dictionary service instance:

    ```csharp
    import { dictionaryService } from './dictionary-service';
    const language = 'en';
    dictionaryService.fetchDictionaryData(language).then(data => {
        // do something with the data
    });
    ```