<sectiondata-mw-section-id="0"id="mwAQ"></section><sectiondata-mw-section-id="1"id="mwAg"><divclass="mw-heading mw-heading2 ext-discussiontools-init-section"><h2id="How_to_authenticate_to_Wikimedia_Commons_Query_Service_using_OAuth_in_Python?"data-mw-thread-id="h-How_to_authenticate_to_Wikimedia_Commons_Query_Service_using_OAuth_in_Python?-2020-12-21T13:38:00.000Z"><spanclass="ext-discussiontools-init-section-subscribe mw-editsection-like"><spanclass="ext-discussiontools-init-section-subscribe-bracket">[</span><ahref=""class="ext-discussiontools-init-section-subscribe-link"role="button"tabindex="0"title="(discussiontools-topicsubscription-button-subscribe-tooltip)">(discussiontools-topicsubscription-button-subscribe)</a><spanclass="ext-discussiontools-init-section-subscribe-bracket">]</span></span><spandata-mw-comment-start=""id="h-How_to_authenticate_to_Wikimedia_Commons_Query_Service_using_OAuth_in_Python?-2020-12-21T13:38:00.000Z"></span><spanid="How_to_authenticate_to_Wikimedia_Commons_Query_Service_using_OAuth_in_Python.3F"typeof="mw:FallbackId"></span>How to authenticate to Wikimedia Commons Query Service using OAuth in Python?<spandata-mw-comment-end="h-How_to_authenticate_to_Wikimedia_Commons_Query_Service_using_OAuth_in_Python?-2020-12-21T13:38:00.000Z"></span></h2><spanclass='ext-discussiontools-init-section-ellipsisButton oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-frameless oo-ui-iconElement oo-ui-buttonWidget'data-ooui='{"_":"OO.ui.ButtonMenuSelectWidget","rel":["nofollow"],"framed":false,"icon":"ellipsis","classes":["ext-discussiontools-init-section-ellipsisButton"]}'><arole='button'tabindex='0'rel='nofollow'class='oo-ui-buttonElement-button'><spanclass='oo-ui-iconElement-icon oo-ui-icon-ellipsis'></span><spanclass='oo-ui-labelElement-label'></span><spanclass='oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator'></span></a></span><divclass="ext-discussiontools-init-section-bar"><divclass="ext-discussiontools-init-section-metadata"><spanclass='ext-discussiontools-init-section-metaitem ext-discussiontools-init-section-timestampLabel'>(discussiontools-topicheader-latestcomment: <ahref="#c-Multichill-2021-02-13T18:31:00.000Z-Zache-2021-01-04T06:55:00.000Z">1613241060</a>)</span><spanclass='ext-discussiontools-init-section-metaitem ext-discussiontools-init-section-commentCountLabel'>(discussiontools-topicheader-commentcount: 3)</span><spanclass='ext-discussiontools-init-section-metaitem ext-discussiontools-init-section-authorCountLabel'>(discussiontools-topicheader-authorcount: 3)</span></div><divclass="ext-discussiontools-init-section-actions"><spanclass='ext-discussiontools-init-section-subscribeButton oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-frameless oo-ui-iconElement oo-ui-labelElement oo-ui-flaggedElement-progressive oo-ui-buttonWidget'data-ooui='{"_":"OO.ui.ButtonWidget","rel":["nofollow"],"framed":false,"icon":"bellOutline","label":"(discussiontools-topicsubscription-button-subscribe-label)","title":"(discussiontools-topicsubscription-button-subscribe-tooltip)","flags":["progressive"],"classes":["ext-discussiontools-init-section-subscribeButton"]}'><arole='button'title='(discussiontools-topicsubscription-button-subscribe-tooltip)'tabindex='0'rel='nofollow'class='oo-ui-buttonElement-button'><spanclass='oo-ui-iconElement-icon oo-ui-icon-bellOutline oo-ui-image-progressive'></span><spanclass='oo-ui-labelElement-label'>(discussiontools-topicsubscription-button-subscribe-label)</span><spanclass='oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator oo-ui-image-progressive'></span></a></span></div></div></div>
<pid="mwAw"><spandata-mw-comment-start=""id="c-FrankieRayRobertson-2020-12-21T13:38:00.000Z-How_to_authenticate_to_Wikimedia_Commons_Query_Service_using_OAuth_in_Python?"></span>This page says it's possible to authenticate against the query service using OAuth, but has anyone managed to do so programmatically from Python? If anyone has any working code, in any language, I would appreciate whatever you can share. I've asked the full question including my not-working Python code on StackOverflow: <arel="mw:ExtLink"href="https://stackoverflow.com/questions/65303450/how-to-authenticate-to-wikimedia-commons-query-service-using-oauth-in-python"class="external free"id="mwBA">https://stackoverflow.com/questions/65303450/how-to-authenticate-to-wikimedia-commons-query-service-using-oauth-in-python</a> --<arel="mw:WikiLink"href="./User:FrankieRayRobertson"title="User:FrankieRayRobertson"class="new"id="mwBQ">FrankieRayRobertson</a> (<arel="mw:WikiLink"href="./User_talk:FrankieRayRobertson"title="User talk:FrankieRayRobertson"id="mwBg"><spanclass="signature-talk"id="mwBw"><spanabout="#mwt1"typeof="mw:Transclusion"data-mw="{"parts":[{"template":{"target":{"wt":"int:Talkpagelinktext","function":"int"},"params":{},"i":0}}]}"id="mwCA">talk</span></span></a>) 13:38, 21 December 2020 (UTC)<spanclass="ext-discussiontools-init-replylink-buttons"data-mw-thread-id="c-FrankieRayRobertson-2020-12-21T13:38:00.000Z-How_to_authenticate_to_Wikimedia_Commons_Query_Service_using_OAuth_in_Python?"><spanclass="ext-discussiontools-init-replybutton oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-frameless oo-ui-iconElement oo-ui-labelElement oo-ui-flaggedElement-progressive oo-ui-buttonWidget"data-ooui='{"_":"OO.ui.ButtonWidget","rel":["nofollow"],"framed":false,"icon":"share","label":"(discussiontools-replybutton)","flags":["progressive"],"classes":["ext-discussiontools-init-replybutton"]}'><arole="button"tabindex="0"rel="nofollow"class="oo-ui-buttonElement-button"><spanclass="oo-ui-iconElement-icon oo-ui-icon-share oo-ui-image-progressive"></span><spanclass="oo-ui-labelElement-label">(discussiontools-replybutton)</span><spanclass="oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator oo-ui-image-progressive"></span></a></span><spanclass="ext-discussiontools-init-replylink-bracket">[</span><aclass="ext-discussiontools-init-replylink-reply"role="button"tabindex="0"href="">(discussiontools-replylink)</a><spanclass="ext-discussiontools-init-replylink-bracket">]</span></span><spandata-mw-comment-end="c-FrankieRayRobertson-2020-12-21T13:38:00.000Z-How_to_authenticate_to_Wikimedia_Commons_Query_Service_using_OAuth_in_Python?"></span></p>
<dlid="mwCQ"><ddid="mwCg"><spanclass="template-ping"about="#mwt2"typeof="mw:Transclusion"data-mw="{"parts":[{"template":{"target":{"wt":"ping","href":"./Template:Ping"},"params":{"1":{"wt":"Multichill"}},"i":0}}]}"id="mwCw"><spandata-mw-comment-start=""id="c-Zache-2021-01-04T06:55:00.000Z-FrankieRayRobertson-2020-12-21T13:38:00.000Z"></span>@<arel="mw:WikiLink"href="./User:Multichill"title="User:Multichill">Multichill</a>: </span> do you have example code for this / are you using WCQS with python? --<arel="mw:WikiLink"href="./User:Zache"title="User:Zache"id="mwDA">Zache</a> (<arel="mw:WikiLink"href="./User_talk:Zache"title="User talk:Zache"id="mwDQ"><spanclass="signature-talk"id="mwDg"><spanabout="#mwt3"typeof="mw:Transclusion"data-mw="{"parts":[{"template":{"target":{"wt":"int:Talkpagelinktext","function":"int"},"params":{},"i":0}}]}"id="mwDw">talk</span></span></a>) 06:55, 4 January 2021 (UTC)<spanclass="ext-discussiontools-init-replylink-buttons"data-mw-thread-id="c-Zache-2021-01-04T06:55:00.000Z-FrankieRayRobertson-2020-12-21T13:38:00.000Z"><spanclass="ext-discussiontools-init-replybutton oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-frameless oo-ui-iconElement oo-ui-labelElement oo-ui-flaggedElement-progressive oo-ui-buttonWidget"data-ooui='{"_":"OO.ui.ButtonWidget","rel":["nofollow"],"framed":false,"icon":"share","label":"(discussiontools-replybutton)","flags":["progressive"],"classes":["ext-discussiontools-init-replybutton"]}'><arole="button"tabindex="0"rel="nofollow"class="oo-ui-buttonElement-button"><spanclass="oo-ui-iconElement-icon oo-ui-icon-share oo-ui-image-progressive"></span><spanclass="oo-ui-labelElement-label">(discussiontools-replybutton)</span><spanclass="oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator oo-ui-image-progressive"></span></a></span><spanclass="ext-discussiontools-init-replylink-bracket">[</span><aclass="ext-discussiontools-init-replylink-reply"role="button"tabindex="0"href="">(discussiontools-replylink)</a><spanclass="ext-discussiontools-init-replylink-bracket">]</span></span><spandata-mw-comment-end="c-Zache-2021-01-04T06:55:00.000Z-FrankieRayRobertson-2020-12-21T13:38:00.000Z"></span>
<dlid="mwEA"><ddid="mwEQ"><spanclass="template-ping"about="#mwt4"typeof="mw:Transclusion"data-mw="{"parts":[{"template":{"target":{"wt":"Ping","href":"./Template:Ping"},"params":{"1":{"wt":"Zache"}},"i":0}}]}"id="mwEg"><spandata-mw-comment-start=""id="c-Multichill-2021-02-13T18:31:00.000Z-Zache-2021-01-04T06:55:00.000Z"></span>@<arel="mw:WikiLink"href="./User:Zache"title="User:Zache">Zache</a>: </span> no, would have to look into this. Should be part of Pywikibot if someone figures it out. Did you already file a task in phabricator to add support for <arel="mw:ExtLink"href="https://wcqs-beta.wmflabs.org/"class="external free"id="mwEw">https://wcqs-beta.wmflabs.org/</a><spantypeof="mw:DisplaySpace"id="mwFA"></span>? <arel="mw:WikiLink"href="./User:Multichill"title="User:Multichill"id="mwFQ">Multichill</a> (<arel="mw:WikiLink"href="./User_talk:Multichill"title="User talk:Multichill"id="mwFg">talk</a>) 18:31, 13 February 2021 (UTC)<spanclass="ext-discussiontools-init-replylink-buttons"data-mw-thread-id="c-Multichill-2021-02-13T18:31:00.000Z-Zache-2021-01-04T06:55:00.000Z"><spanclass="ext-discussiontools-init-replybutton oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-frameless oo-ui-iconElement oo-ui-labelElement oo-ui-flaggedElement-progressive oo-ui-buttonWidget"data-ooui='{"_":"OO.ui.ButtonWidget","rel":["nofollow"],"framed":false,"icon":"share","label":"(discussiontools-replybutton)","flags":["progressive"],"classes":["ext-discussiontools-init-replybutton"]}'><arole="button"tabindex="0"rel="nofollow"class="oo-ui-buttonElement-button"><spanclass="oo-ui-iconElement-icon oo-ui-icon-share oo-ui-image-progressive"></span><spanclass="oo-ui-labelElement-label">(discussiontools-replybutton)</span><spanclass="oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator oo-ui-image-progressive"></span></a></span><spanclass="ext-discussiontools-init-replylink-bracket">[</span><aclass="ext-discussiontools-init-replylink-reply"role="button"tabindex="0"href="">(discussiontools-replylink)</a><spanclass="ext-discussiontools-init-replylink-bracket">]</span></span><spandata-mw-comment-end="c-Multichill-2021-02-13T18:31:00.000Z-Zache-2021-01-04T06:55:00.000Z"></span></dd></dl></dd></dl>
<pid="mwGA"><spandata-mw-comment-start=""id="c-Marsupium-2021-12-28T00:30:00.000Z-HTTP_500,_server_down?"></span>For me <codeid="mwGQ"><arel="mw:ExtLink"href="https://wcqs-beta.wmflabs.org/"class="external free"id="mwGg">https://wcqs-beta.wmflabs.org/</a></code> throws a 500 Internal Server Error:</p>
<pid="mwHA">Is this known? Any information when the query service might be back? Thanks in advance for any information or linking to relevant other places! --<arel="mw:WikiLink"href="./User:Marsupium"title="User:Marsupium"id="mwHQ">Marsupium</a> (<arel="mw:WikiLink"href="./User_talk:Marsupium"title="User talk:Marsupium"id="mwHg"><spanclass="signature-talk"id="mwHw"><spanabout="#mwt5"typeof="mw:Transclusion"data-mw="{"parts":[{"template":{"target":{"wt":"int:Talkpagelinktext","function":"int"},"params":{},"i":0}}]}"id="mwIA">talk</span></span></a>) 00:30, 28 December 2021 (UTC)<spanclass="ext-discussiontools-init-replylink-buttons"data-mw-thread-id="c-Marsupium-2021-12-28T00:30:00.000Z-HTTP_500,_server_down?"><spanclass="ext-discussiontools-init-replybutton oo-ui-widget oo-ui-widget-enabled oo-ui-buttonElement oo-ui-buttonElement-frameless oo-ui-iconElement oo-ui-labelElement oo-ui-flaggedElement-progressive oo-ui-buttonWidget"data-ooui='{"_":"OO.ui.ButtonWidget","rel":["nofollow"],"framed":false,"icon":"share","label":"(discussiontools-replybutton)","flags":["progressive"],"classes":["ext-discussiontools-init-replybutton"]}'><arole="button"tabindex="0"rel="nofollow"class="oo-ui-buttonElement-button"><spanclass="oo-ui-iconElement-icon oo-ui-icon-share oo-ui-image-progressive"></span><spanclass="oo-ui-labelElement-label">(discussiontools-replybutton)</span><spanclass="oo-ui-indicatorElement-indicator oo-ui-indicatorElement-noIndicator oo-ui-image-progressive"></span></a></span><spanclass="ext-discussiontools-init-replylink-bracket">[</span><aclass="ext-discussiontools-init-replylink-reply"role="button"tabindex="0"href="">(discussiontools-replylink)</a><spanclass="ext-discussiontools-init-replylink-bracket">]</span></span><spandata-mw-comment-end="c-Marsupium-2021-12-28T00:30:00.000Z-HTTP_500,_server_down?"></span></p>