> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hub2.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Public data

# Introduction

These are public endpoints available to all merchants. They provide data on supported countries and providers.

# List of countries

<CodeGroup>
  ```bash CURL theme={null}
  curl --location --request GET 'https://api.hub2.io/data/countries' \
    --header 'Environment: sandbox' \
    --header 'Content-Type: application/json'
  ```

  ```javascript Javascript theme={null}
  const url = 'https://api.hub2.io/data/countries';
  const headers = {
    'Environment': 'sandbox',
    'Content-Type': 'application/json'
  };

  fetch(url, {
    method: 'GET',
    headers: headers
  })
    .then(response => {
      if (!response.ok) {
        throw new Error('Network response was not ok');
      }
      return response.json();
    })
    .then(data => {
      console.log(data);
    })
    .catch(error => {
      console.error('There was a problem with your fetch operation:', error);
    });

  ```

  ```python Python theme={null}
  import requests

  url = 'https://api.hub2.io/data/countries'
  headers = {
      'Environment': 'sandbox',
      'Content-Type': 'application/json'
  }

  response = requests.get(url, headers=headers)

  if response.status_code == 200:
      print(response.json())
  else:
      print('Error:', response.status_code)
  ```

  ```java Java theme={null}
  import java.io.BufferedReader;
  import java.io.InputStreamReader;
  import java.net.HttpURLConnection;
  import java.net.URL;

  public class Main {
      public static void main(String[] args) {
          try {
              URL url = new URL("https://api.hub2.io/data/countries");
              HttpURLConnection connection = (HttpURLConnection) url.openConnection();
              connection.setRequestMethod("GET");
              connection.setRequestProperty("Environment", "sandbox");
              connection.setRequestProperty("Content-Type", "application/json");

              int responseCode = connection.getResponseCode();
              if (responseCode == HttpURLConnection.HTTP_OK) {
                  BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                  String inputLine;
                  StringBuffer response = new StringBuffer();

                  while ((inputLine = in.readLine()) != null) {
                      response.append(inputLine);
                  }
                  in.close();

                  System.out.println(response.toString());
              } else {
                  System.out.println("Error: " + responseCode);
              }
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }
  ```
</CodeGroup>

<Info>
  Please check the endpoint details in the [API reference](/api-reference/data/get-countries) for full details.
</Info>

<Tip>
  The country code (BF, SN, etc.) should be used in the destination fields for payments and transfers.
</Tip>

# List of providers

<CodeGroup>
  ```bash CURL theme={null}
  curl --location --request GET 'https://api.hub2.io/data/providers' \
    --header 'Environment: sandbox' \
    --header 'Content-Type: application/json'
  ```

  ```javascript Javascript theme={null}
  const url = 'https://api.hub2.io/data/providers';
  const headers = {
    'Environment': 'sandbox',
    'Content-Type': 'application/json'
  };

  fetch(url, {
    method: 'GET',
    headers: headers
  })
    .then(response => {
      if (!response.ok) {
        throw new Error('Network response was not ok');
      }
      return response.json();
    })
    .then(data => {
      console.log(data);
    })
    .catch(error => {
      console.error('There was a problem with your fetch operation:', error);
    });

  ```

  ```python Python theme={null}
  import requests

  url = 'https://api.hub2.io/data/providers'
  headers = {
      'Environment': 'sandbox',
      'Content-Type': 'application/json'
  }

  response = requests.get(url, headers=headers)

  if response.status_code == 200:
      print(response.json())
  else:
      print('Error:', response.status_code)
  ```

  ```java Java theme={null}
  import java.io.BufferedReader;
  import java.io.InputStreamReader;
  import java.net.HttpURLConnection;
  import java.net.URL;

  public class Main {
      public static void main(String[] args) {
          try {
              URL url = new URL("https://api.hub2.io/data/providers");
              HttpURLConnection connection = (HttpURLConnection) url.openConnection();
              connection.setRequestMethod("GET");
              connection.setRequestProperty("Environment", "sandbox");
              connection.setRequestProperty("Content-Type", "application/json");

              int responseCode = connection.getResponseCode();
              if (responseCode == HttpURLConnection.HTTP_OK) {
                  BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                  String inputLine;
                  StringBuffer response = new StringBuffer();

                  while ((inputLine = in.readLine()) != null) {
                      response.append(inputLine);
                  }
                  in.close();

                  System.out.println(response.toString());
              } else {
                  System.out.println("Error: " + responseCode);
              }
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }
  ```
</CodeGroup>

<Info>
  Please check the endpoint details in the [API reference](/api-reference/data/get-providers) for full details.
</Info>

<Tip>
  The name of the provider should be used in the destination fields for payments and transfers. This field is case-insensitive.
</Tip>
