Site icon DataForSEO

Managing DataForSEO POST and GET API requests in Make

This comprehensive guide will walk you through the process of data retrieval with the Standard method of DataForSEO APIs (POST and GET API calls) in the Make platform. We’ll show you how to create and configure scenarios that will allow you to send and receive API requests in a few clicks. While we utilize Google Reviews API in this example, the principles and steps below can be applied to any other DataForSEO API. Let’s get started!

Setting Up Scenarios

To implement the functionality for managing DataForSEO POST and GET requests in the Make platform, you’ll need to create two scenarios: one for sending an API request to get reviews and another for receiving them.

Scenario 1: Receiving data

First, let’s prepare the scenario for receiving the results of API requests, which is review data in our example.

1 In the Scenario creation more, click the plus button to add a new module, then search for Webhooks, and select Custom webhook.

2 In the window that opens, click “Create webhook,” give it a meaningful name, and click “Save.”

3 Click “Copy address to clipboard” to copy the webhook URL. You will need this URL to configure the next scenario to send API requests. Leave this scenario in data waiting mode (as shown in the screenshot with the “Stop” button and loader).

Scenario 2: Requesting data

Next, let’s configure the scenario for setting tasks via API requests.

1 In a new window, open a new scenario.

2 Add and configure the DataForSEO module titled “Make an API call.”

Create a new connection or select an existing connection to DataForSEO.
In the URL field, enter the necessary relative path of the endpoint as in the example: /business_data/google/reviews/task_post.
In the Method field, select POST.

In the BODY field, insert the following JSON code, replacing the variables as needed:

[
    {
        "location_name": "LOCATION_NAME",
        "language_name": "LANGUAGE_NAME",
        "keyword": "KEYWORD",
        "depth": 50,
        "sort_by": "highest_rating",
        "pingback_url": "WEBHOOK_URL?id=$id"
    }
]

For setting Google Reviews API tasks, replace the variables as follows:

You can also adjust the values according to your needs, refer to our documentation for details.

Click “OK” and save the scenario. Click “Run once.”

3 After the scenario runs successfully, click the number next to the module. In the window that opens, copy the Task ID value from Output -> Bundle1 -> Body -> Tasks -> 1 -> id. You will need this for the previous scenario.

Returning to Scenario 1 to finish the setup

1 Wait until the red “Stop” button changes to the green “Successfully determined” message, then click “OK.”

2 Add the DataForSEO module titled “Make an API call”.

In the URL field, enter the necessary endpoint path, such as: /business_data/google/reviews/task_get/.
Then, append the ID value from the previous Webhooks module by clicking on it. Close the module settings by clicking “OK.”

3 Right-click the DataForSEO module and select “Run this module only.”

In the window that opens, enter the copied id value from the previous scenario and click “OK.” Wait for the module to execute.

4 Add the Iterator module and in the Array field, select: DataForSEO (Make an API call) -> Body -> tasks[] -> result[] -> items[].

5 Add the Google Sheets module titled “Add a row.”

In the Connection field, create a new connection or select an existing one.
In the Spreadsheet ID field, select the table where the results should be recorded. We use the following example table: Google Sheets Example.
In the Sheet name field, select the desired sheet.
In Values, select the corresponding fields from the Iterator module.

6 Close the module by clicking “OK,” then save, and activate the scenario.

The scenario is now ready. It will automatically trigger when DataForSEO API sends a response, processing the results according to the task set in Scenario 2.

Running the Scenarios

Now, you can run the scenarios when needed and receive data in Google Sheets when it is ready. If you want to collect data for different parameters, you can always adjust your POST request body without having to make any further changes.

Conclusion

By following these instructions, you can efficiently handle DataForSEO POST and GET API requests in Make.com, ensuring accurate and timely information for your projects. Remember, the principles outlined here can be adapted to other APIs, so don’t hesitate to explore our documentation and try this with other endpoints.

Exit mobile version