# Retrieve Historical Data

To create a fetch task to retrieve historical data from Gnip, follow these steps.

To create a new Fetch Task

1. Stop the connector.
2. Open the configuration file in a text editor.

3. In the `[FetchTasks]` section of the configuration file, specify the number of fetch tasks using the `Number` parameter. If you are configuring the first fetch task, type `Number=1`. If one or more fetch tasks have already been configured, increase the value of the `Number` parameter by one (1). Below the `Number` parameter, specify the names of the fetch tasks, starting from zero (0). For example:

       [FetchTasks]
       Number=1
       0=MyTask

4. Below the `[FetchTasks]` section, create a new TaskName section. The name of the section must match the name of the new fetch task. For example:

       [FetchTasks]
       Number=1
       0=MyTask

       [MyTask]

1. In the new section, set the following configuration parameters:

   `AccountName` | The name of the Gnip account that you want to retrieve historical data from. You can find your account name from https://console.gnip.com/.
   `BasicUsername` | The user name to use to access Gnip. Micro Focus recommends you encrypt the value of this parameter before adding it to the configuration file. For information about how to encrypt parameter values, see Encrypt Passwords.
   `BasicPassword` | The password to use to access Gnip. Micro Focus recommends you encrypt the value of this parameter before adding it to the configuration file. For information about how to encrypt parameter values, see Encrypt Passwords.
   `JobNamePrefix` | (Optional) Before the connector retrieves data from the Gnip Historical API it must provide a name to identify the job. The connector provides a GUID, but you can use this parameter to add a string before the GUID, to help you identify the job.
   `Rules` | A list of rules to use to select the data to retrieve from Gnip. An item is retrieved if it matches any of the rules. For information about how to construct rules, refer to the Gnip developer documentation.
   `RuleTags` | A list of tags to use to tag the rules specified by the `Rules` parameter. You must enter the same number of values that you entered for `Rules`. Each entry that is returned from the Gnip Historical API includes the tags for the rules that it matched. The connector includes these tags in document metadata so that you can determine which rule(s) caused an entry to be retrieved.
   `MaxQuoteDollars` | The maximum cost allowed for the historical job, in US Dollars (USD), in order for the connector to accept the job and proceed. If the quote for the historical job returned by Gnip exceeds this value, the connector rejects the job and the synchronize task fails.

2. Specify the time period to retrieve data from:

   `StartDate` | The start time of the time period that you want to retrieve data for. Specify either: A date in the format `YYYY-MM-DD HH:NN`, and in the UTC time zone. A time duration, to make the start time relative to the time when the synchronize task starts. For example, to retrieve data no older than 7 days use the value `-7 days`.
   `EndDate` | The end time of the time period that you want to retrieve data for. Specify either: A date in the format `YYYY-MM-DD HH:NN`, and in the UTC time zone. A time duration, to make the end time relative to the time when the synchronize task starts. For example, to retrieve data that is at least one day old, use the value `-1 days`.

3. (Optional) If the connector is installed on a machine that is behind a proxy server, you might also need to set some additional configuration parameters so that the connector can access the internet. For more information, see Use a Proxy Server to Access Gnip.

4. Save and close the configuration file.

_FT_HTML5_bannerTitle.htm