Retrieve Insights - GET
Palenca analyzes and enriches the employment information of your users' accounts in order to help you make better decisions.
In order to consult the employment trends of one your accounts, you need to make a GET
request to the endpoint:
GET https://api.palenca.com/v1/accounts/:account_id/insights
Note
This endpoint is currently available only for IMSS's accounts.
- JavaScript
- Python
- curl
const axios = require('axios')
const config = {
method: 'get',
url: 'https://api.palenca.com/v1/accounts/:account_id/insights',
headers: {
'x-api-key': 'private_api_key',
'Content-Type': 'application/json'
}
};
(async () => {
try {
const {data} = await axios(config)
console.info(JSON.stringify(response.data))
} catch (error) {
console.error(error)
}
})()
import requests
url = 'https://api.palenca.com/v1/accounts/:account_id/insights'
headers = {
'x-api-key': 'private_api_key',
'Content-Type': 'application/json'
}
response = requests.request('GET', url, headers=headers)
curl --location --request GET 'https://api.palenca.com/v1/accounts/:account_id/insights'
--header 'x-api-key: private_api_key' \
--header 'Content-Type: application/json'
Returns a JSON structured like this:
{
"success": true,
"error": null,
"data": {
"account_id": "ea3b6970-b35d-48bd-9ad1-8687ae8ebbb8",
"work_duration": 2.0,
"salary_progression": 45.0,
"periods_moonlighting": [],
"periods_unemployed": [
{
"start_date": "2017-10-24",
"end_date": "2018-02-01",
"month_duration": 3.3
},
{
"start_date": "2019-03-28",
"end_date": "2021-07-12",
"month_duration": 27.9
}
]
}
}
Field | Description |
---|---|
work_duration | The median duration (in months) of the account's last 3 jobs |
salary_progression | The median salary increase of the account's last 3 jobs (rounded to 0 decimal places) |
periods_moonlighting | Periods where the account worked 2 jobs simultaneously |
periods_unemployed | Periods where the account was unemployed for at least 1 month |