-
Notifications
You must be signed in to change notification settings - Fork 1
/
api_spec.json
125 lines (124 loc) · 3.87 KB
/
api_spec.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{
"openapi": "3.1.0",
"info": {
"title": "PyMC-Marketing MMM API",
"description": "Asynchronous API for running Marketing Mix Modeling.",
"version": "v0.0.3"
},
"servers": [
{
"url": "https://gcr2gce-proxy-i66d5bzhua-uc.a.run.app"
}
],
"paths": {
"/run_mmm_async": {
"post": {
"description": "Initiates an asynchronous MMM model run.",
"operationId": "runMMMAsync",
"requestBody": {
"description": "Data and parameters for the MMM model.",
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"df": {
"type": "string",
"description": "Data in JSON format for the model."
},
"date_column": {
"type": "string",
"default": "date",
"description": "Name of the date column in data."
},
"channel_columns": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of channel column names."
},
"adstock_max_lag": {
"type": "integer",
"default": 8,
"description": "Maximum lag for adstock calculation."
},
"yearly_seasonality": {
"type": "integer",
"default": 2,
"description": "Yearly seasonality factor."
}
}
}
}
}
},
"responses": {
"200": {
"description": "Model run initiated successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"task_id": {
"type": "string",
"description": "Unique ID for the initiated task."
}
}
}
}
}
}
}
}
},
"/get_results": {
"get": {
"description": "Retrieves the results of an MMM model run.",
"operationId": "getMMMResults",
"parameters": [
{
"name": "task_id",
"in": "query",
"required": true,
"description": "The task ID of the MMM model run.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Status of the model execution.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Status of the model execution."
},
"summary": {
"type": "string",
"description": "JSON string of summary statistics, present if status is 'completed'."
},
"error": {
"type": "string",
"description": "Error message, present if status is 'failed'."
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {}
}
}