Add Log In View Sign Up Search Back Next

Integrate APIs using the aapi SDK Creator

Introduction

The following tutorial provides an introduction to aapi integrations using the aapi Software Development Kit (SDK) Creator.

In following the tutorial, you will learn to easily program against an API using your programming language and IDE of choice (we use the New York Times Article Search API, Python and the Pycharm IDE here), with programming specific SDKs created from the aapi SDK creator.

Pre-Requisites

Required

Tutorial Selections

General Steps

  1. Create your aapi developer account and add an API to aapi.
  2. Create your SDK(s) with the aapi SDK creator in your programming language(s).
  3. Set up the SDK and start coding!

Detailed Steps

  1. If you haven’t registered a FREE aapi developer account, visit https://cloud.aapi.io/register
  2. Once logged into https://cloud.aapi.io, add your API (for the tutorial, we add the NY Times Article Search API through the search menu).
  3. After you click add, you will be prompted for your API key..

NOTE: In the tutorial, because you have received a single key from the New York Times Articles API, you will place the key in the Client ID, and leave Client Secret empty.  This will be the same for any API that only requires a single key for API access.

  1. Now that the API is added to the system, you will need to run the SDK creator to create your SDK:
    1. After downloading the SDK creator, run the program.
    2. Accept the license agreement:
    3. Set your installation and project path
      1. The installation path is where aapi SDK generator executable will be installed
      2. The project path is where your aapi SDK will be installed for the specific API(s).
    4. Choose your programming language (We will use Python in the tutorial):
    5. Login with your standard aapi credentials:
    6. Select the relevant New York Times Article Search API (and others if you would like):
    7. After selecting your API(s), press continue and the installation of the SDK will take place.
    8. If you don’t remember the path, you can still view the path in the view button on the last page:
  2. After installation is complete, import the project into your IDE (we use Pycharm within the tutorial).
  3. Set up the SDK within your IDE. (Here we will use Python/Pycharm IDE to program).
    1. Add a python file called run.py
    2. Open the README.md file, follow installation instructions as shown:
    3. Copy the section of python code:
    4. Past into the newly created run.py file: (NOTE: If authentication is not added in the readme.md file, then you will need to add it as shown in the example below)

config = io_aapi_Article_Search_API.Configuration()

  1. api_client = io_aapi_Article_Search_API.ApiClient(config)
  2. set_default_header(header_name=’api-key’, header_value=’KeyFromNyTimesHere’)
  3. api_instance = io_aapi_Article_Search_API.StoriesApi(api_client)

  1. Start Programming!
    1. Now that you are connected to your API you can review all available endpoints inside the stories_api.py file with available documentation in the docs folder. Good luck!