-
Notifications
You must be signed in to change notification settings - Fork 0
API Design
Samyoga Bhattarai edited this page Jul 6, 2021
·
30 revisions
"area_of_interest": "businesses" or "workforce"
"type": "Impact" or "Need" or "Outlook" or "Preparedness"
"survey_question": ""
{
"message": "Successfully fetched",
"code": 200,
"csv_link": "_____.csv"
}
limit: 20
page_number: 1
{
"message": "Successfully fetched",
"code": 200,
"data": [
{
"id": "",
"category": "economy",
"title": "",
"writer": "",
"created_at": "",
"image": "",
"article" : "",
},
{
"id": "",
"category": "social",
"title": "",
"writer": "",
"created_at": "",
"image": "",
"article" : "",
}
]
}
{
"message": "Successfully fetched",
"code": 200,
"data": {
"title": "",
"writer": "",
"created_at": "",
"image": "",
"image_caption": "",
"article": ""
}
}
-
var_group
can take the following values:impact
,preparednes
,
{
"message": "Successfully fetched",
"code": 200,
"data": {
"highlights": [
{
"variablename": "revenue_category",
"variablegroup": "impact",
"label": {
"en": "Revenues for most of the businesses is almost zero",
"ne": "धेरै जसो ब्यापारका लागि राजस्व शून्य छ"
}
},
{
"variablename": "employment_category",
"variablegroup": "outlook",
"label": {
"en": "Around 95% businesses shut down, among them 17% will never open again",
"ne": "लगभग 95% व्यवसायहरू बन्द भए, ती मध्ये 17% फेरि कहिले पनि खून्य छ"
}
}
],
"distribution": {
"revenue_category": [
{
"label": {
"en": "None or insignificant impact",
"ne": ""
},
"total": "",
"perc_of_total": "",
"geometries": {
"features": [
{
"businessname": "Himalayan restaurant",
"businesstype": "Restaurant and Bar",
"geometry": {
"type": "Point",
"coordinates": [
[
4.446657,
51.02457
]
]
}
},
{
"businessname": "Himalayan restaurant",
"businesstype": "Restaurant and Bar",
"geometry": {
"type": "Point",
"coordinates": [
[
4.446657,
51.02457
]
]
}
}
]
}
},
{
"label": "Revenue for 2020 was below 25% of 2019",
"total": "",
"perc_of_total": "",
"geometries": {
"features": [
{
"businessname": "Himalayan restaurant",
"businesstype": "Restaurant and Bar",
"geometry": {
"type": "Point",
"coordinates": [
[
4.446657,
51.02457
]
]
}
},
{
"businessname": "Himalayan restaurant",
"businesstype": "Restaurant and Bar",
"geometry": {
"type": "Point",
"coordinates": [
[
4.446657,
51.02457
]
]
}
}
]
}
}
],
"employment_category": [
{
"label": "",
"total": "",
"perc_of_total": "",
"geometries": {
"features": [
{
"businessname": "Himalayan restaurant",
"businesstype": "Restaurant and Bar",
"geometry": {
"type": "Point",
"coordinates": [
[
4.446657,
51.02457
]
]
}
},
{
"businessname": "Himalayan restaurant",
"businesstype": "Restaurant and Bar",
"geometry": {
"type": "Point",
"coordinates": [
[
4.446657,
51.02457
]
]
}
}
]
}
},
{
"label": "",
"total": "",
"perc_of_total": "",
"geometries": {
"features": [
{
"businessname": "Himalayan restaurant",
"businesstype": "Restaurant and Bar",
"geometry": {
"type": "Point",
"coordinates": [
[
4.446657,
51.02457
]
]
}
},
{
"businessname": "Himalayan restaurant",
"businesstype": "Restaurant and Bar",
"geometry": {
"type": "Point",
"coordinates": [
[
4.446657,
51.02457
]
]
}
}
]
}
}
]
}
}
}
-
survey
can take the following values:workers
,businesses
-
var_group
can take the following values:impact
,preparednes
,outlook
,need
This was previously /viz/workers/univariate
.
{
"message": "Successfully fetched",
"code": 200,
"data": [
{
"variable": "b_has_loan",
"title": {
"en": "Do you have any outstanding loans?",
"ne": ""
},
"asked_condition": "general",
"asked_total": "110",
"dist": [
{
"label": {
"en": "No",
"ne": ""
},
"total": "",
"perc_of_total": ""
},
{
"label": {
"en": "No",
"ne": ""
},
"total": "",
"perc_of_total": ""
}
]
},
{
"variable": "i_lost_job",
"title": {
"en": "Did you lose your job during the pandemic?",
"ne": ""
},
"asked_condition": "general",
"asked_total": "110",
"dist": [
{
"label": {
"en": "Yes",
"ne": ""
},
"total": "",
"perc_of_total": ""
},
{
"label": {
"en": "No",
"ne": ""
},
"total": "",
"perc_of_total": ""
}
]
}
]
}
-
survey
can take the following values:workers
,businesses
-
var_group
can take the following values:impact
,preparednes
, -
dimension
can take the following values:gender
,edu_levl
,
This was previously /viz/workers/bivariate
.
{
"message": "Successfully fetched",
"code": 200,
"data": {
"univariate": [
{
variable: "m_gender",
varable_label_en: "Do you have any outstanding loans", // maybe not needed if metadata available
variable_label_ne: "",
dist: [
{
label_ne: "",
label_en: "Male",
total: "",
perc_of_total: "",
},
{
label_ne: "",
label_en: "Female",
total: "",
perc_of_total: "",
},
{
label_ne: "",
label_en: "Third gendder",
total: "",
perc_of_total: "",
},
],
},
],
"bivariate": [
{
"title_en": "",
"title_ne": "",
"chart_data": [
{
"y_label_en": "",
"y_label_ne": "",
"total": "",
"perc_of_total": "",
"dist": [
{
"x_label_en": "",
"x_label_ne": "",
"total": "",
"perc_of_total": ""
},
{
"x_label_en": "",
"x_label_ne": "",
"total": "",
"perc_of_total": ""
},
{
"x_label_en": "",
"x_label_ne": "",
"total": "",
"perc_of_total": ""
}
]
},
{
"y_label_en": "",
"y_label_ne": "",
"total": "",
"perc_of_total": "",
"dist": [
{
"x_label_en": "",
"x_label_ne": "",
"total": "",
"perc_of_total": ""
},
{
"x_label_en": "",
"x_label_ne": "",
"total": "",
"perc_of_total": ""
},
{
"x_label_en": "",
"x_label_ne": "",
"total": "",
"perc_of_total": ""
}
]
}
]
}
]
}
}