Smartocto Insights API: How to extract articles from API
If you want to create a custom report that requires more articles than what is available in the Insights tool, you can do it with Smartocto API Explorer
- In the top right corner, click on your profile, then Edit account
- Scroll down to the API key and copy it
- Open the API Explorer via this link: Smartocto API Explorer
- Click on the button Authorize, paste the API key you copied from the Insights tool, click Authorize, and then close the window by pressing on the X
- Click on the Try out so you can start entering values in the fields below
- In the Dimensions, field enter the value you want to retrieve. Usually, it’s article
- In the domain_id field enter your Insight Domain ID. It’s a four-digit number located in the URL of your Insight tool when you are on the Overview page
- In the date_from and date_to enter the dates you want to extract. Please note that the date format is YYYY-MM-DD (for example 2022-04-30). Here is an example of how to populate the fields:
- In the limit field in API Explorer enter how many articles you want to extract. To prevent missing some articles, go to the Insights tool ( Insights > Article) and select the date you entered in the API Explorer. In the example below we can see that for the selected period there are 2.3k articles so in the limit field in the API explorer we will enter 2400 just to be safe
- In the format field in the API Explorer enter csv using lowercase letters
- Scroll down and click on Execute
- Once API is done loading, click on a download button, and it will download the file in the txt format. It will download a file usually called response with some numbers
- Once downloaded open Excel and create a blank workbook
- In the Blank Workbook, select the Data menu
- Click on Get Data > From File > From Text/CSV
- Select the file you downloaded (usually called response with some numbers)
- Click Open and once it's open, click on Load and your data is ready