Troubleshooting of WikiData API: Difference between revisions
Jump to navigation
Jump to search
(Created page with " == How to fix the error Unrecognized value for parameter "props": sitelinks/zhwiki == When I request the API url: https://www.wikidata.org/w/api.php?action=wbgetentities&form...") |
mNo edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Troubleshooting of WikiData API OR Wikipedia API | |||
== How to fix the error Unrecognized value for parameter "props": sitelinks/zhwiki == | == How to fix the error Unrecognized value for parameter "props": sitelinks/zhwiki == | ||
| Line 25: | Line 26: | ||
Solution | Solution | ||
* You can change the URL parameter {{kbd|key=<nowiki>sitelinks/zhwiki</nowiki>}} to {{kbd|key=<nowiki>sitelinks</nowiki>}} e.g. https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&props=labels|sitelinks&ids=Q21007575&languages=zh | * You can change the URL parameter {{kbd|key=<nowiki>sitelinks/zhwiki</nowiki>}} to {{kbd|key=<nowiki>sitelinks</nowiki>}} e.g. https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&props=labels|sitelinks&ids=Q21007575&languages=zh | ||
== How to fix the error "Our servers are currently under maintenance or experiencing a technical problem." == | |||
When using PHP curl the url {{kbd|key=<nowiki>https://zh.wikipedia.org/w/api.php?action=query&prop=extracts&titles=<title>&explaintext=1&formatversion=2&format=json</nowiki>}} met the following error | |||
<pre> | |||
Error | |||
Our servers are currently under maintenance or experiencing a technical problem. Please try again in a few minutes. | |||
See the error message at the bottom of this page for more information. | |||
</pre> | |||
Solution | |||
* Try to send the same request later | |||
* Change the URL parameter (default) strict-origin-when-cross-origin to {{kbd|key=<nowiki>origin=*</nowiki>}} e.g. {{kbd|key=<nowiki>https://zh.wikipedia.org/w/api.php?action=query&prop=extracts&titles=<title>&explaintext=1&formatversion=2&format=json&origin=*</nowiki>}}<ref>[https://ithelp.ithome.com.tw/articles/10196319 (30apis) Day 19 : Wikipedia (MediaWiki) API - iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天]</ref> | |||
== Further reading == | |||
* [https://stackoverflow.com/questions/tagged/wikidata-api Highest scored 'wikidata-api' questions - Stack Overflow] | |||
* [https://en.wikipedia.org/wiki/Wikipedia:Wikimedia_Foundation_error Wikipedia:Wikimedia Foundation error - Wikipedia] | |||
== References == | |||
<references /> | |||
{{Template:Troubleshooting}} | |||
[[Category:WikiData]] [[Category:Open data]] | [[Category:WikiData]] [[Category:Open data]] | ||
Latest revision as of 21:39, 17 July 2023
Troubleshooting of WikiData API OR Wikipedia API
How to fix the error Unrecognized value for parameter "props": sitelinks/zhwiki[edit]
When I request the API url: https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&props=labels%7Csitelinks/zhwiki&ids=Q21007575&languages=zh , I met the error message:
{
"warnings": {
"wbgetentities": {
"*": "Unrecognized value for parameter \"props\": sitelinks/zhwiki"
}
},
"entities": {
"Q21007575": {
"type": "item",
"id": "Q21007575",
"labels": {}
}
},
"success": 1
}
Root cause
- The page did not have the property sitelinks/zhwiki
Solution
- You can change the URL parameter sitelinks/zhwiki to sitelinks e.g. https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&props=labels%7Csitelinks&ids=Q21007575&languages=zh
How to fix the error "Our servers are currently under maintenance or experiencing a technical problem."[edit]
When using PHP curl the url https://zh.wikipedia.org/w/api.php?action=query&prop=extracts&titles=<title>&explaintext=1&formatversion=2&format=json met the following error
Error Our servers are currently under maintenance or experiencing a technical problem. Please try again in a few minutes. See the error message at the bottom of this page for more information.
Solution
- Try to send the same request later
- Change the URL parameter (default) strict-origin-when-cross-origin to origin=* e.g. https://zh.wikipedia.org/w/api.php?action=query&prop=extracts&titles=<title>&explaintext=1&formatversion=2&format=json&origin=*[1]
Further reading[edit]
References[edit]
Troubleshooting of ...
- PHP, cUrl, Python, selenium, HTTP status code errors
- Database: SQL syntax debug, MySQL errors, MySQLTuner errors or PostgreSQL errors
- HTML/Javascript: Troubleshooting of javascript, XPath
- Software: Mediawiki, Docker, FTP problems, online conference software
- Test connectivity for the web service, Web Ping, Network problem, Web user behavior, Web scrape troubleshooting
Template