If your team has a coding background and needs to automate the way to export data or control tasks, you may try out Octoparse OpenAPI.

In this tutorial, we will demonstrate how to connect Octoparse API step by step through an HTTP requester application Postman.

NOTE:

  • Please note that this tutorial is only for showing some basic settings when you connect to our API and you can follow it to see if the API works for you. However, the steps demonstrated here cannot be automated. If you want an automated way to export the data, you need to code it yourself

  • For more information about Octoparse OpenAPI, please check out this document: Octoparse OpenAPI Document

To start with, you might need to know that Octoparse provides Standard and Professional plans with different API services. You may need to upgrade your account to enjoy more APIs.

mceclip0.jpg

Here in this tutorial, we will demonstrate how to connect to two API services as examples.

  1. Get Access Token

  2. Get task group information


Get Access Token

You need to get the Access Token first as you need to add the access token to the header of the other requests.

mceclip0.png
  • Go to the Headers section and put "Content-Type" in the KEY field and "application/json" in the VALUE field

mceclip1.png
  • Go to the Body section, select raw, copy and paste the code below, and make sure that the detected format is JSON

{    "username": "account username",    "password": "account password",    "grant_type": "password"}
  • Replace the account username with your Octoparse account user name, and the account password with your Octoparse account password

Note: Please make sure to input your username instead of an email address.

body.jpg
  • Click SEND to start requesting

If your token is successfully requested, you will see a response like this:

mceclip3.png

NOTE:

  • The correct token code should be between "access_token" and "token_type" and without quotation marks

  • The token you've been given will only be valid for 24 hours. We suggest that you use the same token within its valid time frame.

  • You may either request a new token using the service or use Refresh Token to get a new one when the token expires.

mceclip5.png

Get task group information

mceclip6.png
  • Go to the Headers section, input Authorization in the KEY field, and "Bearer {Access Token}" in the VALUE field

NOTE: When pasting the token code in the VALUE column, leave a space between the "Bearer" and the token.

mceclip7.png
  • Replace {Access Token} with the token code you get in the last step (don't keep the “{}“)

If you get the response below, then congratulations! You've already connected to the Octoparse API successfully.

mceclip8.png
Did this answer your question?