Troubleshooting of WikiData API: Difference between revisions

From LemonWiki共筆
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...")
 
No edit summary
Line 25: Line 25:
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
{{Template:Troubleshooting}}


[[Category:WikiData]] [[Category:Open data]]
[[Category:WikiData]] [[Category:Open data]]

Revision as of 10:28, 17 July 2023

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&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


Troubleshooting of ...

Template