badrevids by querying API error

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

badrevids by querying API error

Larry D'Agostino
I'm looking into the Wikiloop Battlefield data http://battlefield.wikiloop.org/feed/mix and trying to query the data via the API using revision id.

My attempts appear to return with "badrevids".

Am i using the API incorrectly?


Here is my sample python code...


import requests

S = requests.Session()

URL = "https://www.mediawiki.org/w/api.php"

PARAMS = {
    "action": "query",
    "prop": "revisions",
    "revids": 961090023,
    "rvprop": "ids|timestamp|user|comment|content",
    "rvslots": "main",
    "formatversion": "2",
    "format": "json"
}



R = S.get(url=URL, params=PARAMS)
DATA = R.json()

PAGES = DATA["query"]

for page in PAGES:
    print(page)

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: badrevids by querying API error

Jay prakash
Change the endpoint URL. It is mediawiki.org and you are referring another URL.

Thanks :) regards

On Tue, Jun 23, 2020, 4:14 AM Larry D'Agostino <[hidden email]> wrote:
I'm looking into the Wikiloop Battlefield data http://battlefield.wikiloop.org/feed/mix and trying to query the data via the API using revision id.

My attempts appear to return with "badrevids".

Am i using the API incorrectly?


Here is my sample python code...


import requests

S = requests.Session()

URL = "https://www.mediawiki.org/w/api.php"

PARAMS = {
    "action": "query",
    "prop": "revisions",
    "revids": 961090023,
    "rvprop": "ids|timestamp|user|comment|content",
    "rvslots": "main",
    "formatversion": "2",
    "format": "json"
}



R = S.get(url=URL, params=PARAMS)
DATA = R.json()

PAGES = DATA["query"]

for page in PAGES:
    print(page)
_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: badrevids by querying API error

Larry D'Agostino
That's interesting.  I'm using this API page as a reference to the python code  https://www.mediawiki.org/wiki/API:Revisions.  It has to use URL = "https://www.mediawiki.org/w/api.php".  Is that not correct as in my sample code?

On Mon, Jun 22, 2020 at 11:54 PM Jay prakash <[hidden email]> wrote:
Change the endpoint URL. It is mediawiki.org and you are referring another URL.

Thanks :) regards

On Tue, Jun 23, 2020, 4:14 AM Larry D'Agostino <[hidden email]> wrote:
I'm looking into the Wikiloop Battlefield data http://battlefield.wikiloop.org/feed/mix and trying to query the data via the API using revision id.

My attempts appear to return with "badrevids".

Am i using the API incorrectly?


Here is my sample python code...


import requests

S = requests.Session()

URL = "https://www.mediawiki.org/w/api.php"

PARAMS = {
    "action": "query",
    "prop": "revisions",
    "revids": 961090023,
    "rvprop": "ids|timestamp|user|comment|content",
    "rvslots": "main",
    "formatversion": "2",
    "format": "json"
}



R = S.get(url=URL, params=PARAMS)
DATA = R.json()

PAGES = DATA["query"]

for page in PAGES:
    print(page)
_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api