Support conversion of linkshere
[dueringa_WikiWalker.git] / doc / jsonformat.md
blobf8df764555bd01f70c1227cc17d304f0ec939364
1 # JSON format 1
3 ## Unlimited
5     {
6        "limits" : {
7           "links" : 500
8        },
9        "batchcomplete" : "",
10        "query" : {
11           "normalized" : [
12              {
13                 "to" : "Heinrich Ambros Eckert",
14                 "from" : "Heinrich_Ambros_Eckert"
15              }
16           ],
17           "pages" : {
18              "8283280" : {
19                 "links" : [
20                    {
21                       "title" : "10. Februar",
22                       "ns" : 0
23                    },
24                    {
25                       "title" : "16. Oktober",
26                       "ns" : 0
27                    },
28                    // .....
29                 ],
30                 "title" : "Heinrich Ambros Eckert",
31                 "ns" : 0,
32                 "pageid" : 8283280
33              }
34           }
35        }
36     }
38 ## Limited
40     {
41        "query" : {
42           "pages" : {
43              "8283280" : {
44                 "links" : [
45                    {
46                       "ns" : 0,
47                       "title" : "10. Februar"
48                    },
49                    {
50                       "ns" : 0,
51                       "title" : "16. Oktober"
52                    }
53                 ],
54                 "ns" : 0,
55                 "title" : "Heinrich Ambros Eckert",
56                 "pageid" : 8283280
57              }
58           },
59           "normalized" : [
60              {
61                 "to" : "Heinrich Ambros Eckert",
62                 "from" : "Heinrich_Ambros_Eckert"
63              }
64           ]
65        },
66        "continue" : {
67           "continue" : "||",
68           "plcontinue" : "8283280|0|1807"
69        }
70     }
72 # JSON format 2
74 ## Unlimited
76     {
77        "limits" : {
78           "links" : 500
79        },
80        "query" : {
81           "pages" : [
82              {
83                 "title" : "Heinrich Ambros Eckert",
84                 "pageid" : 8283280,
85                 "links" : [
86                    {
87                       "ns" : 0,
88                       "title" : "10. Februar"
89                    },
90                    {
91                       "title" : "16. Oktober",
92                       "ns" : 0
93                    },
94                    // ...
95                 ],
96                 "ns" : 0
97              }
98           ],
99           "normalized" : [
100              {
101                 "to" : "Heinrich Ambros Eckert",
102                 "from" : "Heinrich_Ambros_Eckert",
103                 "fromencoded" : false
104              }
105           ]
106        },
107        "batchcomplete" : true
108     }
110 ## Limited
112     {
113        "query" : {
114           "normalized" : [
115              {
116                 "fromencoded" : false,
117                 "from" : "Heinrich_Ambros_Eckert",
118                 "to" : "Heinrich Ambros Eckert"
119              }
120           ],
121           "pages" : [
122              {
123                 "title" : "Heinrich Ambros Eckert",
124                 "links" : [
125                    {
126                       "ns" : 0,
127                       "title" : "10. Februar"
128                    },
129                    {
130                       "ns" : 0,
131                       "title" : "16. Oktober"
132                    }
133                 ],
134                 "pageid" : 8283280,
135                 "ns" : 0
136              }
137           ]
138        },
139        "continue" : {
140           "continue" : "||",
141           "plcontinue" : "8283280|0|1807"
142        }
143     }
145 ## Continue generator
147 /w/api.php?action=query&format=json&prop=links&titles=$whatever&generator=links&formatversion=2&plnamespace=0&pllimit=$whatever&gplnamespace=0
149     {
150         "continue": {
151             "plcontinue": "19978|0|Fort_William_Henry_Harrison",
152             "continue": "||"
153         },
154         "query": {
155             "pages": [
156                 {
157                 ...
158                 },
159                 // contains all pages with pageid, ns and title, bzt without links
160                 {
161                 ...
162                 }
163             ]
164         }
165     }
167 ## multiple titles
169     {
170         "batchcomplete": true,
171         "query": {
172             "normalized": [
173                 {
174                     "fromencoded": false,
175                     "from": "Zanfina_Ismajli",
176                     "to": "Zanfina Ismajli"
177                 },
178                 {
179                     "fromencoded": false,
180                     "from": "Kleite_(Tochter_des_Danaos)",
181                     "to": "Kleite (Tochter des Danaos)"
182                 }
183             ],
184             "pages": [
185                 {
186                     "pageid": 2834303,
187                     "ns": 0,
188                     "title": "Zanfina Ismajli",
189                     "links": [
190                         {
191                             "ns": 0,
192                             "title": "10. Mai"
193                         },
194                         {
195                             "ns": 0,
196                             "title": "1985"
197                         },
198                         // ...
199                     ]
200                 },
201                 {
202                     "pageid": 8086803,
203                     "ns": 0,
204                     "title": "Kleite (Tochter des Danaos)",
205                     "links": [
206                         {
207                             "ns": 0,
208                             "title": "Aigyptos"
209                         },
210                         {
211                             "ns": 0,
212                             "title": "Altgriechische Sprache"
213                         }
214                         // ...
215                     ]
216                 }
217             ]
218         },
219         "limits": {
220             "links": 500
221         }
222     }
224 ## missing articles
226     {
227         "query": {
228             "pages": [
229                 {
230                     "ns": 0,
231                     "title": "Drahtsäge",
232                     "missing": true
233                 }
234                 // ...
235             ]
236         }
237     }