API Portal apiportalwiki https://api.wikimedia.org/wiki/Main_Page MediaWiki 1.47.0-wmf.6 first-letter Media Special Talk User User talk API Portal API Portal talk File File talk MediaWiki MediaWiki talk Template Template talk Help Help talk Category Category talk TimedText TimedText talk Module Module talk Talk:Community 1 143 2380 2350 2026-06-11T17:37:08Z APaskulin (WMF) 20 /* Background */ Reply 2380 wikitext text/x-wiki Welcome to the discussion for the [[Community]] page! To leave a comment, [[Special:UserLogin|log in]] and select '''Edit'''. == Feed api is down == When I try to fetch this api endpoint https://api.wikimedia.org/feed/v1/wikipedia/en/featured/2025/03/28 it gives me error like this: { "type": "<nowiki>https://mediawiki.org/wiki/HyperSwitch/errors/not_found#route</nowiki>", "title": "Not found.", "method": "get", "uri": "/en.wikipedia.org/v1/feed/featured/2025/03/28" } [[User:Alamin-dev|Alamin ]] ([[User talk:Alamin-dev|talk]]) 07:35, 28 March 2025 (UTC) : Hi [[User:Alamin-dev|Alamin]], Thanks for catching this! I was able to replicate the behavior you're seeing, have identified the issue, and have opened a bug report ([[phab:T390317]]). I expect we'll be able to get a fix out next week; I'll post again here to confirm once the fix is deployed. In the meantime, you can access the feed endpoints through the wiki URLs. For example: https://en.wikipedia.org/api/rest_v1/feed/featured/2025/03/28 --[[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 20:55, 28 March 2025 (UTC) ::This is now fixed! Let me know if you run into any other issues. [[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 17:38, 2 April 2025 (UTC) :::Well it works now but the news articles data is still missing in this api which was available before. [[User:Alamin-dev|Alamin ]] ([[User talk:Alamin-dev|talk]]) 18:35, 17 April 2025 (UTC) ::::Hi, The news data is only available for the current day, not for any past days. For example, https://api.wikimedia.org/feed/v1/wikipedia/en/featured/2025/04/17 has the news data for today. [[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 19:06, 17 April 2025 (UTC) == Feed API example is not visible == The endpoint example for curl, Python, PHP, JavaScript are not being shown. The title is there but the example endpoints are not visible. Actually, it shows up for a few milliseconds at the beginning of page load, but then it vanishes. Here is a screenshot of where the problem is: [https://i.ibb.co.com/zTvZjgCr/Screenshot-2025-04-18-154452.png Screenshot link] [[User:Alamin-dev|Alamin ]] ([[User talk:Alamin-dev|talk]]) 09:47, 18 April 2025 (UTC) : Hi [[User:Alamin-dev|Alamin]], Can you share the browser and the MediaWiki skin that you're using? --[[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 16:17, 22 April 2025 (UTC) :I've updated the gadget, and the examples are visible for me now. Let me know if the examples still aren't working for you. [[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 22:34, 2 July 2025 (UTC) == Announcement: API Portal shutdown == The Wikimedia Foundation has decided to shut down the API Portal wiki as part of a new [https://techblog.wikimedia.org/2025/06/12/apis-as-a-product-investing-in-the-current-and-next-generation-of-technical-contributors/ strategy for Wikimedia APIs]. We’re still working on exact plans and schedules, but here is a general idea of what to expect: * '''Endpoints''': api.wikimedia.org endpoints will continue to work as currently documented until at least June 2026. Starting in the second half of 2026, api.wikimedia.org endpoints will be migrated to new routes and eventually deprecated. * '''API keys''': Most API keys created through the API Portal will continue to work. You can manage your API keys through [[meta:Special:OAuthConsumerRegistration/list|Special:OAuthConsumerRegistration on Meta-Wiki]]. * '''Docs''': Documentation from the API Portal will be consolidated and moved to other technical documentation wikis. We’ll be providing more details about the planned shut down in the next couple of months. To get the latest updates, add this page to your [[mw:Special:MyLanguage/Help:Watchlist|watchlist]] or subscribe to the [https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/ mediawiki-api-announce mailing list]. We’d like to thank everyone who has contributed to the API Portal for being part of this community! We hope you'll continue to follow API projects in the future. === Background === In 2020, the Wikimedia Foundation Platform Engineering Team wanted to create a home for Wikimedia API docs that was similar to other popular API docs sites, and that allowed developers to more easily create and manage API keys. Building the API Portal as a standalone wiki benefits from the advantages of MediaWiki: * Ease of editing * Ability to translate content * Community collaboration through talk pages, watchlists, and other features However, using a standalone wiki for the API Portal also has disadvantages: * '''Administration''': Each new wiki needs a community of administrators, page patrollers, and other functionaries. A new wiki adds work for the Wikimedia technical community. * '''Technical complexity''': MediaWiki is a complex ecosystem. Since the API Portal works differently from other Wikimedia wikis, we often find bugs that come from interactions with extensions, skins, and other wikis. * '''Visual inconsistency''': The API Portal’s simplified visual design makes it difficult to access wiki features like special pages. In addition, global skin preferences can override the API Portal’s visual design entirely, making the site difficult to use. Wikimedia Foundation’s Product Management, MediaWiki Interfaces, and Tech Docs teams have decided that the disadvantages of implementing the API Portal as a standalone wiki outweigh the advantages. In 2026, we’ll be working on plans to overcome these disadvantages and reimagining ways to make API docs easy to find, use, and create. --[[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 16:49, 22 January 2026 (UTC) :Hi all, Here's an update on the API Portal shut down: :* The API Portal wiki will be inaccessible starting in June 2026. :* To learn about Wikimedia APIs and find links to docs, visit the new [[mw:Wikimedia APIs|landing page]] (work in progress) on mediawiki.org. :* Starting in late March or early April 2026, api.wikimedia.org endpoints will have the same [[mw:Wikimedia APIs/Rate limits|rate limits]] as other Wikimedia APIs. The new rate limits are higher than the [[wikitech:API_Portal/Deprecation#API_Portal_historical_rate_limits|current rate limits]], so this change should not create any issues. The Lift Wing API will continue to have the same [[Lift Wing API/Rate limits|custom rate limits]] with only minor clarifications. :* For a timeline and the latest project information, see the [[wikitech:API_Portal/Deprecation|project page]]. :If you have any questions, want to share your feedback, or have any issues with functionality related to the API Portal, feel free to: :* Leave a comment here :* Post to the [[wikitech:Talk:API_Portal/Deprecation|project talk page]] :* Email techdocs[at]wikimedia.org :[[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 18:39, 18 March 2026 (UTC) ::Can you please clarify this for the average person. Apologies if this is completely obvious to developers who live in this space. ::* Above, you say: "API Portal wiki will be inaccessible starting in June 2026" - It is now June 5, 2026. "api.wikimedia.org/wiki/Main_Page" is still accessible. Is this to be expected? ::* While you say "API Portal wiki will be inaccessible," the top of the "Main page" says something slightly different: "'''Announcement''': The API Portal is shutting down in 2026. [[Talk:Community#Announcement: API Portal shutdown|Learn more]]" - Aren't "API Portal" and "API Portal wiki" two different things with two different fates? Is the wording in the "Announcement" accurate? Should it not say the "API Portal wiki" is shutting down in 2026? ::* I now see that the "Deprecation" page at [[wikitech:API_Portal/Deprecation]] has some more clarity, but it's still not entirely consistent with the messages here. While you say "The API Portal is shutting down in 2026" the table in Deprecation says no such thing – it simply says "api.wikimedia.org API endpoints" -> "Gradual deprecation." Is that deadline at the end of 2026 or is there some other update you can provide? ::* The only endpoint I can find for LiftWing is at "api.wikimedia.org/wiki/Lift_Wing_API" – is there something better yet at this point that will supersede it? if this, and other endpoints, are to be deprecated by the end of 2026, does that mean any coding solution against api.wikimedia.org are going to be out of date within 6 months? ::Thanks for any clarity here. I know it cannot be easy to un-consolidate these many different APIs. But as a community of practice, a lot of us are having a tough time figuring out what goes where. - [[User:Fuzheado|Fuzheado]] ([[User talk:Fuzheado|talk]]) 12:03, 5 June 2026 (UTC) :::Hi @[[User:Fuzheado|Fuzheado]], Thanks for your feedback! My apologies that things haven't been clear. :::* Yes, it's expected. We're planning to start the process of making the API Portal inaccessible later this month. We don't have an exact date yet since we're still working on creating a new location for the Lift Wing API docs. Once those docs are complete, I'll send an update with the exact dates. :::* If I understand correctly, you're understanding the API Portal wiki to be the site itself while the API Portal in general includes the endpoints and other functionality. That makes sense to me. I'll update the banner on the main page to specify that the wiki itself is shutting down. :::* I see the confusion that you're referring to with this. The API Portal wiki is shutting down this month. The api.wikimedia.org API endpoints will continue to work after the API Portal wiki is shut down. Eventually, these endpoints will be deprecated and migrated to new URLs, but unfortunately, I don't have a specific timeline for this process yet. The project to create the new API URLs that will replace the api.wikimedia.org APIs is scheduled for sometime between July 2026 and March 2027. Once these new API URLs are ready to use, we'll start a deprecation process for the api.wikimedia.org APIs. This process will include several months for developers to migrate to the new API URLs before the api.wikimedia.org APIs stop working. :::* Unfortunately, that is correct. Any coding solution that uses api.wikimedia.org endpoints will be out of date eventually, and we don't yet know what the new API endpoints are that developers will need to migrate to. However, we are committed to helping developers as much as we can during the migration process. We'll be looking at the usage of the api.wikimedia.org API endpoints and trying to reach out to developers proactively so no one is surprised. My guess is that the api.wikimedia.org endpoints won't be fully deprecated until mid-2027, but I wanted to be conservative about the documented timeline since it could happen by the end of 2026, as you said. The best thing to do for now is to subscribe to one of the communication channels listed on the [[wikitech:API_Portal/Deprecation#Updates|Wikitech page]] to get the latest updates. I'll be updating those channels as soon as I know more. :::I definitely agree that is difficult to figure out what goes where. For now, the best source of API documentation is [[mw:Wikimedia APIs]]. :::Thanks again for this feedback. It's really helpful! I've made some small updates to the [[wikitech:API_Portal/Deprecation|Wikitech page]] to help clarify some of this, but let me know if you have any other questions or feedback. Once the API Portal wiki is shut down, you can always reach me via the [[wikitech:Talk:API_Portal/Deprecation|Wikitech talk page]]. --[[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) [[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 16:35, 5 June 2026 (UTC) ::Hi everyone, ::Here's an update on the shut down of the API Portal wiki: ::* Next week (June 15-18), the API Portal wiki will become read only. ::* The following week (June 22-25), all API Portal wiki URLs will redirect to the [[mw:Wikimedia APIs]]. ::Thank you to everyone who has participated on this wiki! For more information for users of api.wikimedia.org API endpoints, see the [[wikitech:API Portal/Deprecation|project page on Wikitech]]. For any questions or follow-ups, you can reach me on the [[wikitech:Talk:API Portal/Deprecation|project talk page]]. -- [[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 17:37, 11 June 2026 (UTC) == mostread missing from API result == Hi! I've been querying API daily since the start of 2026, specifically for the 'mostread' key in the result. But it seems like this has been missing since 2026/03/02 and onwards. The last available result that contains this key is for 2026/03/01. Did anything change here? Is this a result of the upcoming sunset of this API? This is the endpoint i've been hitting: ''f'''''"<nowiki>https://api.wikimedia.org/feed/v1/wikipedia/{lang}/featured/{y}/{m}/{d}</nowiki>"''' Keys that were being returned on 2026/03/01 (and prior): dict_keys(['tfa', 'mostread', 'image', 'onthisday']) Keys that are being returned on 2026/03/02 (and after): dict_keys(['tfa', 'image', 'onthisday']) -- 'mostread' is missing Thanks! [[User:Cholo5ntrol|Cholo5ntrol]] ([[User talk:Cholo5ntrol|talk]]) 17:30, 3 March 2026 (UTC) :Hi @[[User:Cholo5ntrol|Cholo5ntrol]], thanks for reporting this! mostread isn't available for the current date in UTC, but it should be available for 2026/03/02. I've opened a bug report here: [[phab:T418894]]. This shouldn't be related to the upcoming deprecation, but I'll comment back here when there's an update. [[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 18:03, 3 March 2026 (UTC) ::In the meantime, you can also call the Wikimedia Analytics API to [https://doc.wikimedia.org/generated-data-platform/aqs/analytics-api/reference/page-views.html#list-most-viewed-pages list the most-viewed pages] for a given day. [[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 18:06, 3 March 2026 (UTC) :::Hi @[[User:Cholo5ntrol|Cholo5ntrol]], This endpoint seems to be working as expected now. Let me know if you have any further issues. [[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 15:06, 4 March 2026 (UTC) ::::Thanks @[[User:APaskulin (WMF)|APaskulin (WMF)]]! Confirming that it's working as expected now. [[User:Cholo5ntrol|Cholo5ntrol]] ([[User talk:Cholo5ntrol|talk]]) 15:33, 4 March 2026 (UTC) == I get an 500 internal server error whenever i try to call API with an API key == Since yesterday i get internal server error 500 whenever i try to call a wikipedia api with an valid api key: Example: https://de.wikipedia.org/w/api.php?action=query&list=geosearch&gsbbox=51.08363690226374%7C13.723847814149655%7C51.05171409773626%7C13.742289185850344&gslimit=500&maxlag=5&format=json&continue= Without authentication it works. With token, it doesnt. [[User:Vibesolutions|Vibesolutions]] ([[User talk:Vibesolutions|talk]]) 11:04, 13 March 2026 (UTC) :Hi @[[User:Vibesolutions|Vibesolutions]], Can you say more about which [[Authentication|authentication flow]] you're using? It will help us troubleshoot your issue. [[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 14:17, 13 March 2026 (UTC) ::Hey @[[User:APaskulin (WMF)|APaskulin (WMF)]]. I use the app authentication flow. ::The response is Internal Server Error 500. The response body is: ::<syntaxhighlight lang="html"> ::<html> ::<head> ::<title>Interner Fehler – Wikipedia</title> ::<meta name="color-scheme" content="light dark" /><style>body { font-family: sans-serif; margin: 0; padding: 0.5em 2em; }</style> ::</head> ::<body> ::<div class="cdx-message--error cdx-message cdx-message--block"><span class="cdx-message__icon"></span> ::<div class="cdx-message__content">[634b3019-7662-4804-8bef-5c10b777d531] 2026-03-13 05:59:13: Fataler Ausnahmefehler des Typs „TypeError“</div> ::</div><!-- Set $wgShowExceptionDetails = true; at the bottom :::of LocalSettings.php to show detailed debugging :::information. --></body></html> ::</syntaxhighlight> ::Here is how i retrieve the token: ::<syntaxhighlight lang="typescript"> ::const clientId = this.getClientId(); ::const clientSecret = this.getClientSecret(); ::if (!clientId || !clientSecret) { :: throw new Error("Wikimedia credentials are missing"); ::} ::const body = new URLSearchParams({ ::grant_type: "client_credentials", :: client_id: clientId, :: client_secret: clientSecret, ::}); ::const response = await fetch("https://meta.wikimedia.org/w/rest.php/oauth2/access_token", { :: method: "POST", :: headers: { :: "Content-Type": "application/x-www-form-urlencoded", :: }, :: body: body.toString(), ::}); ::if (response.ok) { ::const data = (await response.json()) as WikimediaTokenResponse; ::if (!data.access_token || !data.expires_in) { :: throw new Error("Wikimedia token response is missing fields"); ::} ::return data; ::} ::</syntaxhighlight> ::the token retrieval works. But i can not call any api with that token. [[User:Vibesolutions|Vibesolutions]] ([[User talk:Vibesolutions|talk]]) 21:57, 13 March 2026 (UTC) :::Hi @[[User:Vibesolutions|Vibesolutions]], Thanks for sharing that info. My apologies that you are encountering this error. This is a known bug in our system. Here the bug report for it: [[phab:T417278]]. There is currently a fix up for review, so I hope it will be resolved soon. I'll post again here when I have an update. [[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 16:54, 16 March 2026 (UTC) ::::Hi @[[User:Vibesolutions|Vibesolutions]], The fix was deployed! I tested the app authentication flow locally, and I was able to get a valid token, so hopefully the issue is fixed for you as well. Let me know if you run into any other issues! [[User:APaskulin (WMF)|APaskulin (WMF)]] ([[User talk:APaskulin (WMF)|talk]]) 21:22, 16 March 2026 (UTC) fmmgd6a8xi8mnfv9aysa3y15u76g43l Lift Wing API/Reference 0 238 2378 2180 2026-06-11T15:26:51Z APaskulin (WMF) 20 Add banner pointing to new docs location 2378 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> A scalable machine learning model serving infrastructure on Kubernetes using the Kserve framework. It is part of a broader project aimed to modernize machine learning at Wikimedia. <div class="container"> <div class="row" style="padding-top:20px; padding-bottom:30px;"> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0; min-height:180px;"> <div class="card-body"> <p class="card-title" style="font-weight:600;">Resources</p> <p class="card-text" style="font-size: 14px;"> › [[Lift Wing API/Reference/Articlequality Score object|Articlequality score object]] </p> <p class="card-text" style="font-size: 14px;"> › [[Lift Wing API/Reference/Revscoring Score object|Revscoring score object]] </p> <p class="card-text" style="font-size: 14px;"> › [[Lift Wing API/Reference/Article_Topic_Outlink_scores_object|Article topic outlink scores object]]</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Revert risk score object|Revert risk score object]]</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Readability score object|Readability score object]]</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Reference_need_score_object|Reference need score object]]</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Reference_risk_score_object|Reference risk score object]]</p> </div> </div> </div> </div> <div class="row" style="padding-top:20px; padding-bottom:30px;"> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0; min-height:180px;"> <div class="card-body"> <p class="card-title" style="font-weight:600;">Edit quality endpoints</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_revscoring_goodfaith_prediction|Get revscoring goodfaith prediction]]</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_revscoring_damaging_prediction|Get revscoring damaging prediction]]</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_revscoring_reverted_prediction|Get revscoring reverted prediction]]</p> </div> </div> </div> </div> <div class="row" style="padding-top:20px; padding-bottom:30px;"> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0; min-height:180px;"> <div class="card-body"> <p class="card-title" style="font-weight:600;">Article quality endpoints</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_revscoring_draftquality_prediction|Get revscoring draftquality prediction]]</p> <p class="card-text" style="font-size: 14px;"> › [[Lift Wing API/Reference/Get_revscoring_articlequality_prediction|Get revscoring articlequality prediction]] </p> <p class="card-text" style="font-size: 14px;"> › [[Lift Wing API/Reference/Get language agnostic articlequality prediction|Get language agnostic articlequality prediction]] </p> </div> </div> </div> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0; min-height:180px;"> <div class="card-body"> <p class="card-title" style="font-weight:600;">Article topic endpoints</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_revscoring_drafttopic_prediction|Get revscoring drafttopic prediction]]</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_revscoring_articletopic_prediction|Get revscoring articletopic prediction]]</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_articletopic_outlink_prediction|Get articletopic outlink prediction]]</p> </div> </div> </div> </div> <div class="row" style="padding-top:20px; padding-bottom:30px;"> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0; min-height:180px;"> <div class="card-body"> <p class="card-title" style="font-weight:600;">Revert Risk endpoints</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_reverted_risk_language_agnostic_prediction|Get reverted risk language agnostic prediction]]</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_reverted_risk_multilingual_prediction|Get reverted risk multilingual prediction]]</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_revertrisk_wikidata|Get revertrisk wikidata prediction]]</p> </div> </div> </div> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0; min-height:180px;"> <div class="card-body"> <p class="card-title" style="font-weight:600;">Readability endpoints</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_readability_prediction|Get readability prediction]]</p> </div> </div> </div> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0; min-height:180px;"> <div class="card-body"> <p class="card-title" style="font-weight:600;">Reference quality endpoints</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_reference_need_prediction|Get reference need prediction]]</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_reference_risk_prediction|Get reference risk prediction]]</p> </div> </div> </div> </div> <div class="row" style="padding-top:20px; padding-bottom:30px;"> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0; min-height:180px;"> <div class="card-body"> <p class="card-title" style="font-weight:600;">Language identification endpoints</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_language_identification_prediction|Get language identification prediction]]</p> </div> </div> </div> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0; min-height:180px;"> <div class="card-body"> <p class="card-title" style="font-weight:600;">Content translation recommendation endpoints</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_content_translation_recommendation|Get content translation recommendations]]</p> </div> </div> </div> </div> <div class="row" style="padding-top:20px; padding-bottom:30px;"> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0; min-height:180px;"> <div class="card-body"> <p class="card-title" style="font-weight:600;">Article descriptions endpoints</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_article_descriptions|Get article descriptions prediction]]</p> </div> </div> </div> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0; min-height:180px;"> <div class="card-body"> <p class="card-title" style="font-weight:600;">Article country endpoints</p> <p class="card-text" style="font-size: 14px;">› [[Lift Wing API/Reference/Get_article_country|Get article descriptions country]]</p> </div> </div> </div> </div> </div> __NOTOC__ {{DEFAULTSORT:3}} ahavmkjxg9bycc5xkgmr6jh1li3v92v Lift Wing API/Reference/Get revscoring goodfaith prediction 0 239 2358 2270 2026-06-11T15:23:47Z APaskulin (WMF) 20 Add banner pointing to new docs location 2358 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|method=POST|endpoint=/service/lw/inference/v1/models/{wiki}-goodfaith:predict|color=#14866d|color2=#d5fdf4}} Get a score from the [https://github.com/wikimedia/revscoring Revscoring] Goodfaith model (previously hosted on [[mw:Special:MyLanguage/ORES|ORES]]) for a given Wiki revision id. Warning: This model is [[wikitech:ORES#Model_deprecation|planned for deprecation]]. Use the [[meta:Machine_learning_models/Production/Multilingual_revert_risk|Multilingual revert risk]] or [[meta:Machine_learning_models/Production/Language-agnostic_revert_risk|Language-agnostic revert risk]] models instead. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-goodfaith:predict -X POST -d '{"rev_id": 12345}' -H "Content-type: application/json"|comment=Get a score from the Revscoring Goodfaith model for the revision 12345 of English Wikipedia.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-goodfaith:predict -X POST -d '{"rev_id": 12345}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" |comment=Get a score from the Revscoring Goodfaith model for the revision 12345 of English Wikipedia.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get a score from the Revscoring Goodfaith model for the revision 12345 of English Wikipedia. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-goodfaith:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 12345 } response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get a score from the Revscoring Goodfaith model for the revision 12345 of English Wikipedia. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-goodfaith:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 12345 }; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == URI Parameters == {| class="wikitable properties" |<code>wiki</code> {{Required}} | Wiki code:<code>arwiki</code> (Arabic), <code>bswiki</code> (Bosnian), <code>cawiki</code> (Catalan), <code>cswiki</code> (Czech), <code>dewiki</code> (German), <code>enwiki</code> (English), <code>eswiki</code> (Spanish), <code>eswikibooks</code> (Spanish Wikibooks), <code>eswikiquote</code> (Spanish Wikiquote), <code>etwiki</code> (Estonian), <code>fawiki</code> (Persian), <code>fiwiki</code> (Finnish), <code>frwiki</code> (French), <code>hewiki</code> (Hebrew), <code>hiwiki</code> (Hindi), <code>huwiki</code> (Hungarian), <code>itwiki</code> (Italian), <code>jawiki</code> (Japanese), <code>kowiki</code> (Korean), <code>lvwiki</code> (Latvian), <code>nlwiki</code> (Dutch), <code>nowiki</code> (Norwegian), <code>plwiki</code> (Polish), <code>ptwiki</code> (Portuguese), <code>rowiki</code> (Romanian), <code>ruwiki</code> (Russian), <code>sqwiki</code> (Albanian), <code>srwiki</code> (Serbian), <code>svwiki</code> (Swedish), <code>ukwiki</code> (Ukrainian), <code>wikidatawiki</code> (Wikidata) or <code>zhwiki</code> (Chinese). |} == POST Parameters == {| class="wikitable properties" |<code>rev_id</code> {{Required}} | Wiki Revision id: integer related to a certain revision id for the Wiki set in the URI parameter. |- |<code>extended_output</code> | Whether or not the response should include the extended output of the model (like the list of features used etc..). Either true or false. Default: false |} == Responses == {| class="wikitable responses" |- !200 | Success: Revision id found. Returns a [[Lift Wing API/Reference/Revscoring Score object|Revscoring score object]]. {{Response start}} <syntaxhighlight lang="json"> { "enwiki": { "models": { "goodfaith": { "version": "0.5.1" } }, "scores": { "12345": { "goodfaith": { "score": { "prediction": true, "probability": { "false": 0.07396339218373627, "true": 0.9260366078162637 } } } } } } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:4}} j17t8n6tdzi4ebbdoyx5j1bfri37y9t Lift Wing API/Reference/Revscoring Score object 0 240 2352 1662 2026-06-11T15:23:16Z APaskulin (WMF) 20 Add banner pointing to new docs location 2352 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> The revision score represents the result of executing a revscoring model with a specific wiki revision ID. == Example == <syntaxhighlight lang="json"> { "enwiki": { "models": { "goodfaith": { "version": "0.5.1" } }, "scores": { "12345": { "goodfaith": { "score": { "prediction": true, "probability": { "false": 0.07396339218373627, "true": 0.9260366078162637 } } } } } } } </syntaxhighlight> == Schema == {| class="wikitable properties" |<code>wiki-code</code> {{Required string}} | String identifying the target Wiki. Example: "enwiki". |- |<code>model-name</code> {{Required string}} | String identifying the model that generated the score. Example "goodfaith". |- |<code>revision-id</code> {{Required string}} | String representing the Wiki revision id. Example "12345". |- |<code>prediction</code>{{required}}{{tag|multiple types}} | The output depends on the model that generated it. It can be: * A boolean. Example true. * A string that represents the article quality label. Example "FA". * An array structure that represents the list of predicted article topics. Example ["STEM.STEM*"]. |- |<code>probability</code> {{Required}}{{tag|map}} | A map structure representing the result of the score (highly depends on the model that generated it). |} __NOTOC__ {{DEFAULTSORT:1}} 7jbybcrgfarfo905kjq7swf3txxy0o7 Lift Wing API/Reference/Get revscoring damaging prediction 0 241 2361 2271 2026-06-11T15:24:33Z APaskulin (WMF) 20 Add banner pointing to new docs location 2361 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/{wiki}-damaging:predict|method=POST|color=#14866d|color2=#d5fdf4}} Get a score from the [https://github.com/wikimedia/revscoring Revscoring] Damaging model (previously hosted on [[mw:Special:MyLanguage/ORES|ORES]]) for a given Wiki revision id. Warning: This model is [[wikitech:ORES#Model_deprecation|planned for deprecation]]. Use the [[meta:Machine_learning_models/Production/Multilingual_revert_risk|Multilingual revert risk]] or [[meta:Machine_learning_models/Production/Language-agnostic_revert_risk|Language-agnostic revert risk]] models instead. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-damaging:predict -X POST -d '{"rev_id": 12345}' -H "Content-type: application/json"|comment=Get a score from the Revscoring Damaging model for the revision 12345 of English Wikipedia.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-damaging:predict -X POST -d '{"rev_id": 12345}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" |comment=Get a score from the Revscoring Damaging model for the revision 12345 of English Wikipedia.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get a score from the Revscoring Damaging model for the revision 12345 of English Wikipedia. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-damaging:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 12345 } response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get a score from the Revscoring Damaging model for the revision 12345 of English Wikipedia. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-damaging:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 12345 }; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == URI Parameters == {| class="wikitable properties" |<code>wiki</code> {{Required}} | Wiki code:<code>arwiki</code> (Arabic), <code>bswiki</code> (Bosnian), <code>cawiki</code> (Catalan), <code>cswiki</code> (Czech), <code>dewiki</code> (German), <code>enwiki</code> (English), <code>eswiki</code> (Spanish), <code>eswikibooks</code> (Spanish Wikibooks), <code>eswikiquote</code> (Spanish Wikiquote), <code>etwiki</code> (Estonian), <code>fawiki</code> (Persian), <code>fiwiki</code> (Finnish), <code>frwiki</code> (French), <code>hewiki</code> (Hebrew), <code>hiwiki</code> (Hindi), <code>huwiki</code> (Hungarian), <code>itwiki</code> (Italian), <code>jawiki</code> (Japanese), <code>kowiki</code> (Korean), <code>lvwiki</code> (Latvian), <code>nlwiki</code> (Dutch), <code>nowiki</code> (Norwegian), <code>plwiki</code> (Polish), <code>ptwiki</code> (Portuguese), <code>rowiki</code> (Romanian), <code>ruwiki</code> (Russian), <code>sqwiki</code> (Albanian), <code>srwiki</code> (Serbian), <code>svwiki</code> (Swedish), <code>ukwiki</code> (Ukrainian), <code>wikidatawiki</code> (Wikidata) or <code>zhwiki</code> (Chinese). |} == POST Parameters == {| class="wikitable properties" |<code>rev_id</code> {{Required}} | Wiki Revision id: integer related to a certain revision id for the Wiki set in the URI parameter. |- |<code>extended_output</code> | Whether or not the response should include the extended output of the model (like the list of features used etc..). Either true or false. Default: false |} == Responses == {| class="wikitable responses" |- !200 | Success: Revision id found. Returns a [[Lift Wing API/Reference/Revscoring Score object|Revscoring score object]]. {{Response start}} <syntaxhighlight lang="json"> { "enwiki": { "models": { "damaging": { "version": "0.5.1" } }, "scores": { "12345": { "damaging": { "score": { "prediction": false, "probability": { "false": 0.744276020191829, "true": 0.255723979808171 } } } } } } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:5}} tlrcvde81t3lfatr436s8nlomlddq46 Lift Wing API/Reference/Get revscoring reverted prediction 0 242 2357 2272 2026-06-11T15:23:40Z APaskulin (WMF) 20 Add banner pointing to new docs location 2357 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/{wiki}-reverted:predict|method=POST|color=#14866d|color2=#d5fdf4}} Get a score from the [https://github.com/wikimedia/revscoring Revscoring] Reverted model (previously hosted on [[mw:Special:MyLanguage/ORES|ORES]]) for a given Wiki revision id. Warning: This model is [[wikitech:ORES#Model_deprecation|planned for deprecation]]. Use the [[meta:Machine_learning_models/Production/Multilingual_revert_risk|Multilingual revert risk]] or [[meta:Machine_learning_models/Production/Language-agnostic_revert_risk|Language-agnostic revert risk]] models instead. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/viwiki-reverted:predict -X POST -d '{"rev_id": 12345}' -H "Content-type: application/json"|comment=Get a score from the Revscoring Reverted model for the revision 12345 of Vietnamese Wikipedia.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/viwiki-reverted:predict -X POST -d '{"rev_id": 12345}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" |comment=Get a score from the Revscoring Reverted model for the revision 12345 of Vietnamese Wikipedia.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get a score from the Revscoring Reverted model for the revision 12345 of Vietnamese Wikipedia. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/viwiki-reverted:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 12345 } response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get a score from the Revscoring Reverted model for the revision 12345 of Vietnamese Wikipedia. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/viwiki-reverted:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 12345 }; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == URI Parameters == {| class="wikitable properties" |<code>wiki</code> {{Required}} | Wiki code:<code>bnwiki</code> (Bangla), <code>elwiki</code> (Greek), <code>enwiktionary</code> (English Wikitionary), <code>glwiki</code> (Galician), <code>hrwiki</code> (Croatian), <code>idwiki</code> (Indonesian), <code>iswiki</code> (Icelandic), <code>tawiki</code> (Tamil) or <code>viwiki</code>(Vietnamese). |} == POST Parameters == {| class="wikitable properties" |<code>rev_id</code> {{Required}} | Wiki Revision id: integer related to a certain revision id for the Wiki set in the URI parameter. |- |<code>extended_output</code> | Whether or not the response should include the extended output of the model (like the list of features used etc..). Either true or false. Default: false |} == Responses == {| class="wikitable responses" |- !200 | Success: Revision id found. Returns a [[Lift Wing API/Reference/Revscoring Score object|Revscoring score object]]. {{Response start}} <syntaxhighlight lang="json"> { "viwiki": { "models": { "reverted": { "version": "0.5.0" } }, "scores": { "12345": { "reverted": { "score": { "prediction": false, "probability": { "false": 0.9342944442219189, "true": 0.06570555577808117 } } } } } } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:6}} nqoheygbh54c0y51dmiecfo4w9xc8r6 Lift Wing API/Reference/Get revscoring drafttopic prediction 0 243 2359 2065 2026-06-11T15:23:51Z APaskulin (WMF) 20 Add banner pointing to new docs location 2359 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/{wiki}-drafttopic:predict|method=POST|color=#14866d|color2=#d5fdf4}} Get a score from the [https://github.com/wikimedia/revscoring Revscoring] Draft Topic model (previously hosted on [[mw:Special:MyLanguage/ORES|ORES]]) for a given Wiki revision id. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-drafttopic:predict -X POST -d '{"rev_id": 12345}' -H "Content-type: application/json"|comment=Get a score from the Revscoring Draft Topic model for the revision 12345 of English Wikipedia.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-drafttopic:predict -X POST -d '{"rev_id": 12345}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" |comment=Get a score from the Revscoring Draft Topic model for the revision 12345 of English Wikipedia.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get a score from the Revscoring Draft Topic model for the revision 12345 of English Wikipedia. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-drafttopic:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 12345 } response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get a score from the Revscoring Draft Topic model for the revision 12345 of English Wikipedia. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-drafttopic:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 12345 }; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == URI Parameters == {| class="wikitable properties" |<code>wiki</code> {{Required}} | Wiki code:<code>enwiki</code> (English). |} == POST Parameters == {| class="wikitable properties" |<code>rev_id</code> {{Required}} | Wiki Revision id: integer related to a certain revision id for the Wiki set in the URI parameter. |- |<code>extended_output</code> | Whether or not the response should include the extended output of the model (like the list of features used etc..). Either true or false. Default: false |} == Responses == {| class="wikitable responses" |- !200 | Success: Revision id found. Returns a [[Lift Wing API/Reference/Revscoring Score object|Revscoring score object]]. {{Response start}} <syntaxhighlight lang="json"> { "enwiki": { "models": { "drafttopic": { "version": "1.3.0" } }, "scores": { "12345": { "drafttopic": { "score": { "prediction": [ "STEM.STEM*" ], "probability": { "Culture.Biography.Biography*": 0.022902630539395685, "Culture.Biography.Women": 0.005067486633806841, "Culture.Food and drink": 0.011552909215159848, "Culture.Internet culture": 0.0018836356548609828, "Culture.Linguistics": 0.000987244438369833, "Culture.Literature": 0.0050423059095638205, "Culture.Media.Books": 0.0008228825281107042, "Culture.Media.Entertainment": 0.027835523391703726, "Culture.Media.Films": 0.0021233422398979594, "Culture.Media.Media*": 0.10369183346752998, "Culture.Media.Music": 0.005345021766065545, "Culture.Media.Radio": 4.71813720695922e-05, "Culture.Media.Software": 0.010991013112889197, "Culture.Media.Television": 0.003745806852443267, "Culture.Media.Video games": 0.0012726195754468794, "Culture.Performing arts": 0.0011692106165364648, "Culture.Philosophy and religion": 0.012211366011815949, "Culture.Sports": 0.008617259930690756, "Culture.Visual arts.Architecture": 0.015175202598187623, "Culture.Visual arts.Comics and Anime": 0.0004580529412803368, "Culture.Visual arts.Fashion": 0.0032463316804348247, "Culture.Visual arts.Visual arts*": 0.04966240731500535, "Geography.Geographical": 0.006501819685165024, "Geography.Regions.Africa.Africa*": 0.004278923507426861, "Geography.Regions.Africa.Central Africa": 0.0003367596839992931, "Geography.Regions.Africa.Eastern Africa": 3.092351159122444e-05, "Geography.Regions.Africa.Northern Africa": 0.0001802204967553657, "Geography.Regions.Africa.Southern Africa": 0.0018079996950138254, "Geography.Regions.Africa.Western Africa": 0.0007251088049127748, "Geography.Regions.Americas.Central America": 0.0004991928760763337, "Geography.Regions.Americas.North America": 0.006380070962953918, "Geography.Regions.Americas.South America": 0.0002306844502170147, "Geography.Regions.Asia.Asia*": 0.017313494735674808, "Geography.Regions.Asia.Central Asia": 0.0008072328532154094, "Geography.Regions.Asia.East Asia": 0.0023203835158971666, "Geography.Regions.Asia.North Asia": 0.00045870078954648444, "Geography.Regions.Asia.South Asia": 0.0009922199817278582, "Geography.Regions.Asia.Southeast Asia": 0.0002738236138644238, "Geography.Regions.Asia.West Asia": 0.004635726599288032, "Geography.Regions.Europe.Eastern Europe": 0.001716235984380361, "Geography.Regions.Europe.Europe*": 0.0077942173009087345, "Geography.Regions.Europe.Northern Europe": 0.0007906624707708472, "Geography.Regions.Europe.Southern Europe": 0.0013950233741366756, "Geography.Regions.Europe.Western Europe": 0.0020105862970372567, "Geography.Regions.Oceania": 0.005480678538779058, "History and Society.Business and economics": 0.010849117305548793, "History and Society.Education": 0.0006190153665937547, "History and Society.History": 0.0075245897065247735, "History and Society.Military and warfare": 0.0016535860240798408, "History and Society.Politics and government": 0.04792153752537525, "History and Society.Society": 0.0062335927532809815, "History and Society.Transportation": 0.0006034027160506236, "STEM.Biology": 0.008912249418159286, "STEM.Chemistry": 0.006101030851625054, "STEM.Computing": 0.09725027056674931, "STEM.Earth and environment": 0.013754905599942706, "STEM.Engineering": 0.0007519463706161267, "STEM.Libraries & Information": 0.0026560386120175325, "STEM.Mathematics": 0.037996709648705176, "STEM.Medicine & Health": 0.12580483337522344, "STEM.Physics": 0.004410180324962277, "STEM.STEM*": 0.9465090911647787, "STEM.Space": 0.003443873426925551, "STEM.Technology": 0.06698348905685471 } } } } } } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:7}} fk7cflw5jhna4uqczsp01v8isnkmvih Lift Wing API/Reference/Get revscoring draftquality prediction 0 244 2360 2067 2026-06-11T15:24:27Z APaskulin (WMF) 20 Add banner pointing to new docs location 2360 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/{wiki}-draftquality:predict|method=POST|color=#14866d|color2=#d5fdf4}} Get a score from the [https://github.com/wikimedia/revscoring Revscoring] Draft Quality model (previously hosted on [[mw:Special:MyLanguage/ORES|ORES]]) for a given Wiki revision id. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-draftquality:predict -X POST -d '{"rev_id": 12345}' -H "Content-type: application/json"|comment=Get a score from the Revscoring Draft Quality model for the revision 12345 of English Wikipedia.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-draftquality:predict -X POST -d '{"rev_id": 12345}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" |comment=Get a score from the Revscoring Draft Quality model for the revision 12345 of English Wikipedia.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get a score from the Revscoring Draft Quality model for the revision 12345 of English Wikipedia. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-draftquality:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 12345 } response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get a score from the Revscoring Draft Quality model for the revision 12345 of English Wikipedia. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-draftquality:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 12345 }; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == URI Parameters == {| class="wikitable properties" |<code>wiki</code> {{Required}} | Wiki code:<code>enwiki</code> (English) or <code>ptwiki</code> (Portuguese). |} == POST Parameters == {| class="wikitable properties" |<code>rev_id</code> {{Required}} | Wiki Revision id: integer related to a certain revision id for the Wiki set in the URI parameter. |- |<code>extended_output</code> | Whether or not the response should include the extended output of the model (like the list of features used etc..). Either true or false. Default: false |} == Responses == {| class="wikitable responses" |- !200 | Success: Revision id found. Returns a [[Lift Wing API/Reference/Revscoring Score object|Revscoring score object]]. {{Response start}} <syntaxhighlight lang="json"> { "enwiki": { "models": { "draftquality": { "version": "0.2.1" } }, "scores": { "12345": { "draftquality": { "score": { "prediction": "spam", "probability": { "OK": 0.2058707138961481, "attack": 0.08356921917837876, "spam": 0.39768296325893626, "vandalism": 0.31287710366653687 } } } } } } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:8}} n5gx8fbimo20b6qrz4st5dbol7m7z7l Lift Wing API/Reference/Get revscoring articlequality prediction 0 245 2363 2069 2026-06-11T15:24:48Z APaskulin (WMF) 20 Add banner pointing to new docs location 2363 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/{wiki}-articlequality:predict|method=POST|color=#14866d|color2=#d5fdf4}} Get a score from the [https://github.com/wikimedia/revscoring Revscoring] Article Quality model (previously hosted on [[mw:Special:MyLanguage/ORES|ORES]]) for a given Wiki revision id. '''Note:''' For historical reasons, the articlequality model that is used for wikidata items uses a different URL scheme (<code>item</code> instead of <code>article</code>), thus the URI for wikidata is <code>/service/lw/inference/v1/models/wikidatawiki-itemquality:predict</code>. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-articlequality:predict -X POST -d '{"rev_id": 12345}' -H "Content-type: application/json"|comment=Get a score from the Revscoring Article Quality model for the revision 12345 of English Wikipedia.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-articlequality:predict -X POST -d '{"rev_id": 12345}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" |comment=Get a score from the Revscoring Article Quality model for the revision 12345 of English Wikipedia.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get a score from the Revscoring Article Quality model for the revision 12345 of English Wikipedia. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-articlequality:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 12345 } response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get a score from the Revscoring Article Quality model for the revision 12345 of English Wikipedia. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-articlequality:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 12345 }; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == URI Parameters == {| class="wikitable properties" |<code>wiki</code> {{Required}} | Wiki code:<code>enwiki</code> (English), <code>euwiki</code> (Basque), <code>fawiki</code> (Persian), <code>frwiki</code> (French), <code>glwiki</code> (Galician), <code>nlwiki</code> (Dutch), <code>ptwiki</code> (Portoguese), <code>ruwiki</code> (Russian), <code>svwiki</code> (Swedish), <code>trwiki</code> (Turkish), <code>ukwiki</code> (Ukrainian) or <code>wikidatawiki</code> (Wikidata, see note above). |} == POST Parameters == {| class="wikitable properties" |<code>rev_id</code> {{Required}} | Wiki Revision id: integer related to a certain revision id for the Wiki set in the URI parameter. |- |<code>extended_output</code> | Whether or not the response should include the extended output of the model (like the list of features used etc..). Either true or false. Default: false |} == Responses == {| class="wikitable responses" |- !200 | Success: Revision id found. Returns a [[Lift Wing API/Reference/Revscoring Score object|Revscoring score object]]. {{Response start}} <syntaxhighlight lang="json"> { "enwiki": { "models": { "articlequality": { "version": "0.8.2" } }, "scores": { "12345": { "articlequality": { "score": { "prediction": "Stub", "probability": { "B": 0.0485969161578697, "C": 0.028513124194213476, "FA": 0.0030320049715483475, "GA": 0.005008907686741135, "Start": 0.11763969051576227, "Stub": 0.7972093564738649 } } } } } } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:9}} f56vedingoojmc3wihzrk08pgltcnjn Lift Wing API/Reference/Get revscoring articletopic prediction 0 246 2362 2265 2026-06-11T15:24:42Z APaskulin (WMF) 20 Add banner pointing to new docs location 2362 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/{wiki}-articletopic:predict|method=POST|color=#14866d|color2=#d5fdf4}} Get a score from the [https://meta.wikimedia.org/wiki/Machine_learning_models#Revscoring_models Revscoring Article Topic] models (previously hosted on [[mw:Special:MyLanguage/ORES|ORES]]) for a given Wiki revision id. '''Note:''' For historical reasons, the articletopic model that is used for wikidata items uses a different URL scheme (<code>item</code> instead of <code>article</code>), thus the URI for wikidata is <code>/service/lw/inference/v1/models/wikidatawiki-itemtopic:predict</code>. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-articletopic:predict -X POST -d '{"rev_id": 12345}' -H "Content-type: application/json"|comment=Get a score from the Revscoring Article Topic model for the revision 12345 of English Wikipedia.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-articletopic:predict -X POST -d '{"rev_id": 12345}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" |comment=Get a score from the Revscoring Article Topic model for the revision 12345 of English Wikipedia.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get a score from the Revscoring Article Topic model for the revision 12345 of English Wikipedia. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-articletopic:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 12345 } response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get a score from the Revscoring Article Topic model for the revision 12345 of English Wikipedia. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-articletopic:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 12345 }; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == URI Parameters == {| class="wikitable properties" |<code>wiki</code> {{Required}} | Wiki code:<code>arwiki</code> (Arabic), <code>cswiki</code> (Czech), <code>enwiki</code> (English), <code>euwiki</code> (Basque), <code>huwiki</code> (Hungarian), <code>hywiki</code> (Armenian), <code>kowiki</code> (Korean), <code>srwiki</code> (Serbian), <code>ukwiki</code> (Ukrainian), <code>viwiki</code> (Vietnamese), <code>wikidatawiki</code> (Wikidata, see note above). |} == POST Parameters == {| class="wikitable properties" |<code>rev_id</code> {{Required}} | Wiki Revision id: integer related to a certain revision id for the Wiki set in the URI parameter. |- |<code>extended_output</code> | Whether or not the response should include the extended output of the model (like the list of features used etc..). Either true or false. Default: false |} == Responses == {| class="wikitable responses" |- !200 | Success: Revision id found. Returns a [[Lift Wing API/Reference/Revscoring Score object|Revscoring score object]]. {{Response start}} <syntaxhighlight lang="json"> { "enwiki": { "models": { "articletopic": { "version": "1.3.0" } }, "scores": { "12345": { "articletopic": { "score": { "prediction": [ "STEM.STEM*" ], "probability": { "Culture.Biography.Biography*": 0.0037221493203970753, "Culture.Biography.Women": 0.0016274082204131065, "Culture.Food and drink": 0.003869384114515742, "Culture.Internet culture": 0.0027448342044452587, "Culture.Linguistics": 0.0004704196841241876, "Culture.Literature": 0.0029036128875354625, "Culture.Media.Books": 0.000742678990345212, "Culture.Media.Entertainment": 0.0989755577969651, "Culture.Media.Films": 0.0031771755584005376, "Culture.Media.Media*": 0.21201751150971165, "Culture.Media.Music": 0.0009582260980479466, "Culture.Media.Radio": 6.200606120337714e-05, "Culture.Media.Software": 0.006069833295704291, "Culture.Media.Television": 0.0015207772089172447, "Culture.Media.Video games": 0.0005615093206567188, "Culture.Performing arts": 0.0016136571753909768, "Culture.Philosophy and religion": 0.005162001475415081, "Culture.Sports": 0.006003766168026103, "Culture.Visual arts.Architecture": 0.02932200170357891, "Culture.Visual arts.Comics and Anime": 0.000367749742655391, "Culture.Visual arts.Fashion": 0.0073053897003234405, "Culture.Visual arts.Visual arts*": 0.045704381965926126, "Geography.Geographical": 0.0035315512289540245, "Geography.Regions.Africa.Africa*": 0.00483994316149668, "Geography.Regions.Africa.Central Africa": 0.0004058831032942602, "Geography.Regions.Africa.Eastern Africa": 8.202888604849657e-05, "Geography.Regions.Africa.Northern Africa": 0.00014172395987364393, "Geography.Regions.Africa.Southern Africa": 0.0008028449272043562, "Geography.Regions.Africa.Western Africa": 0.000272816147365302, "Geography.Regions.Americas.Central America": 0.00023176185775056676, "Geography.Regions.Americas.North America": 0.0031703002857622485, "Geography.Regions.Americas.South America": 0.000188786651678672, "Geography.Regions.Asia.Asia*": 0.005622487337808649, "Geography.Regions.Asia.Central Asia": 0.00035000790929257494, "Geography.Regions.Asia.East Asia": 0.0033450611384150454, "Geography.Regions.Asia.North Asia": 0.0004353985298481421, "Geography.Regions.Asia.South Asia": 0.00020663669814920222, "Geography.Regions.Asia.Southeast Asia": 0.00032506406741737574, "Geography.Regions.Asia.West Asia": 0.001011685969040056, "Geography.Regions.Europe.Eastern Europe": 0.0032436576651452653, "Geography.Regions.Europe.Europe*": 0.004678418783680385, "Geography.Regions.Europe.Northern Europe": 0.0003478676128337494, "Geography.Regions.Europe.Southern Europe": 0.0023790437464152685, "Geography.Regions.Europe.Western Europe": 0.001866188163881686, "Geography.Regions.Oceania": 0.020499546152686617, "History and Society.Business and economics": 0.006809005223678666, "History and Society.Education": 0.0004626665847193515, "History and Society.History": 0.003483860446308053, "History and Society.Military and warfare": 0.0007483799946402382, "History and Society.Politics and government": 0.04064941446684307, "History and Society.Society": 0.0039896466301302305, "History and Society.Transportation": 0.0021103679224344224, "STEM.Biology": 0.0063757590084982845, "STEM.Chemistry": 0.002592859482757056, "STEM.Computing": 0.025968220954150065, "STEM.Earth and environment": 0.004485463793376359, "STEM.Engineering": 0.0007893097092528008, "STEM.Libraries & Information": 0.0005542340017675382, "STEM.Mathematics": 0.39109499414712584, "STEM.Medicine & Health": 0.08689195662186826, "STEM.Physics": 0.004884195584942447, "STEM.STEM*": 0.9049354239597514, "STEM.Space": 0.0002139344401835148, "STEM.Technology": 0.07492699172495908 } } } } } } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:10}} tuq6gpthmpo0jwsuaeolo5em74dvdmn Lift Wing API/Reference/Get articletopic outlink prediction 0 247 2374 2229 2026-06-11T15:26:29Z APaskulin (WMF) 20 Add banner pointing to new docs location 2374 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/outlink-topic-model:predict|method=POST|color=#14866d|color2=#d5fdf4}} Get article topics and related scores from the Language agnostic link-based article topic model for a given wiki page. Check the [[metawiki:Machine_learning_models/Production/Language_agnostic_link-based_article_topic_model_card|model card]] for more information. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/outlink-topic-model:predict -X POST -d '{"page_title": "Douglas_Adams", "lang": "en"}' -H "Content-type: application/json"|comment=Get topics and related scores from the Article Topic Outlink model for the page of Douglas Adams on English Wikipedia.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/outlink-topic-model:predict -X POST -d '{"page_title": "Douglas_Adams", "lang": "en"}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" |comment=Get topics and related scores from the Article Topic Outlink model for the page of Douglas Adams on English Wikipedia.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get topics and related scores from the Article Topic Outlink model for the page of Douglas Adams on English Wikipedia. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/outlink-topic-model:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"page_title": "Douglas_Adams", "lang": "en"} response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get topics and related scores from the Article Topic Outlink model for the page of Douglas Adams on English Wikipedia. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/outlink-topic-model:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"page_title": "Douglas_Adams", "lang": "en"}; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == POST Parameters == {| class="wikitable properties" |<code>lang</code> {{Required}} | A string representing the language code related to the target wiki. Example: "en" for English Wikipedia. |- |'''page_id''' |An integer representing the unique identifier of the Wiki article to score. Example: 8091 for the Wiki page of the author Douglas Adams. ''Passing one of `page_id` (recommended) or `page_title` is required!'' |- |<code>page_title</code> | A string representing the title of the Wiki article to score. Example: "Douglas_Adams" for the Wiki page of the author Douglas Adams. ''Passing one of `page_id` (recommended) or `page_title` is required!'' |- |'''revision_id''' |An integer representing the unique identifier of a specific revision of the Wiki article to score. Example: 1335479961 for a particular version of the Douglas Adams article. When provided, the model scores the article as it existed at that specific revision rather than its current state. |- |<code>threshold</code> | A float representing a custom threshold value to use when evaluating the scores. Default: empty. |- |<code>features_str</code> | A string representing custom features to pass to the model. Default: empty. |- |<code>debug</code> | A boolean indicating whether or not to enable debug output to return all predicted topics and scores, equivalent to setting the threshold to 0. Default: false. |} == Responses == {| class="wikitable responses" |- !200 | Success: Returns an [[API reference/Service/Lift Wing/Article Topic Outlink scores object|Article Topic Outlink scores object]]. {{Response start}} <syntaxhighlight lang="json"> { "prediction": { "article": "https://en.wikipedia.org/wiki/Douglas_Adams", "results": [ { "topic": "Culture.Media.Media*", "score": 0.6723417043685913 }, { "topic": "Culture.Biography.Biography*", "score": 0.5156299471855164 } ] } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:13}} 06k9u661mtb48aryo4vva4otmwj6ao7 Lift Wing API/Reference/Article Topic Outlink scores object 0 248 2377 1878 2026-06-11T15:26:43Z APaskulin (WMF) 20 Add banner pointing to new docs location 2377 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> List of topics and their related scores related to a certain Wikipedia article. == Example == <syntaxhighlight lang="json"> { "article": "https://en.wikipedia.org/wiki/Frida_Kahlo", "results": [ {"score": 0.890, "topic": "Culture.Biography.Biography*"}, {"score": 0.516, "topic": "Geography.Regions.Americas.North_America"}, {"score": 0.484, "topic": "Culture.Visual_arts.Visual_arts*"}, {"score": 0.281, "topic": "Culture.Biography.Women"} ] } </syntaxhighlight> == Schema == {| class="wikitable properties" |<code>article</code> {{Required string}} | A string representing the target Wikipedia article. |- |<code>results</code>{{Required}}{{array}} | An array of the map structure representing the result of the predicted topics and their scores. {| class="wikitable" |+ |<code>'''score'''</code>{{required}}{{tag|float}} |Float value of 0-1 representing a score of model confidence that a topic is relevant. |- |<code>'''topic'''</code>{{Required string}} |String representing a topic an article might be relevant to. |} |} __NOTOC__ {{DEFAULTSORT:2}} at2j4eb3t7p0tcsw38m652sr97s9tcd Lift Wing API/Reference/Get reverted risk language agnostic prediction 0 253 2366 2119 2026-06-11T15:25:48Z APaskulin (WMF) 20 Add banner pointing to new docs location 2366 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/revertrisk-language-agnostic:predict|method=POST|color=#14866d|color2=#d5fdf4}} The goal of this model is to detect revisions that might be reverted independently if they were made in good faith or with the intention of creating damage. Check the [[meta:Machine_learning_models/Proposed/Language-agnostic_revert_risk|model card]] for more info. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-language-agnostic:predict -X POST -d '{"rev_id": 123456, "lang": "en"}' -H "Content-type: application/json"|comment=Get the revert risk probability for the edit on English Wikipedia identified by the revision id 123456.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-language-agnostic:predict -X POST -d '{"rev_id": 123456, "lang": "en"}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" |comment=Get the revert risk probability for the edit on English Wikipedia identified by the revision id 123456.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get the revert risk probability for the edit on English Wikipedia identified by the revision id 123456. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-language-agnostic:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 123456, "lang": "en"} response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get the revert risk probability for the edit on English Wikipedia identified by the revision id 123456. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-language-agnostic:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 123456, "lang": "en"}; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == POST Parameters == {| class="wikitable properties" |<code>lang</code> {{Required}} | A string representing the language code related to the target wiki. Example: "en" for English Wikipedia. |- |<code>rev_id</code> {{Required}} | The revision id for the wiki identified by the <code>lang</code> parameter. |} == Responses == {| class="wikitable responses" |- !200 | Success: Returns a [[API reference/Service/Lift Wing/Revert risk score object|Revert risk score object]]. {{Response start}} <syntaxhighlight lang="json"> { "model_name": "revertrisk-language-agnostic", "model_version": "1", "wiki_db": "enwiki", "revision_id": 123456, "output": { "prediction": false, "probabilities": { "true": 0.3058536847305622, "false": 0.6941463152694378 } } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:12}} l9tg8f294rpf4qj3w4ajncwl5vvc7yb Lift Wing API/Reference/Get reverted risk multilingual prediction 0 254 2365 2073 2026-06-11T15:25:43Z APaskulin (WMF) 20 Add banner pointing to new docs location 2365 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/revertrisk-multilingual:predict|method=POST|color=#14866d|color2=#d5fdf4}} The goal of this model is to detect revisions that might be reverted independently if they were made in good faith or with the intention of creating damage. Check the [[meta:Machine_learning_models/Proposed/Multilingual_revert_risk|model card]] for more info. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-multilingual:predict -X POST -d '{"rev_id": 123456, "lang": "en"}' -H "Content-type: application/json"|comment=Get the revert risk probability for the edit on English Wikipedia identified by the revision id 123456.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-multilingual:predict -X POST -d '{"rev_id": 123456, "lang": "en"}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" |comment=Get the revert risk probability for the edit on English Wikipedia identified by the revision id 123456.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get the revert risk probability for the edit on English Wikipedia identified by the revision id 123456. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-multilingual:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 123456, "lang": "en"} response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get the revert risk probability for the edit on English Wikipedia identified by the revision id 123456. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-multilingual:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 123456, "lang": "en"}; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == POST Parameters == {| class="wikitable properties" |<code>lang</code> {{Required}} | A string representing the language code related to the target wiki. Example: "en" for English Wikipedia. Currently 47 languages are supported: <code>ka</code>(Georgian), <code>lv</code>(Latvian), <code>ta</code>(Tamil), <code>ur</code>(Urdu), <code>eo</code>(Esperanto), <code>lt</code>(Lithuanian), <code>sl</code>(Slovenian), <code>hy</code>(Armenian), <code>hr</code>(Croatian), <code>sk</code>(Slovak), <code>eu</code>(Basque), <code>et</code>(Estonian), <code>ms</code>(Malay), <code>az</code>(Azerbaijani), <code>da</code>(Danish), <code>bg</code>(Bulgarian), <code>sr</code>(Serbian), <code>ro</code>(Romanian), <code>el</code>(Greek), <code>th</code>(Thai), <code>bn</code>(Bangla), <code>no</code>(Norwegian), <code>hi</code>(Hindi), <code>ca</code>(Catalan), <code>hu</code>(Hungarian), <code>ko</code>(Korean), <code>fi</code>(Finnish), <code>vi</code>(Vietnamese), <code>uz</code>(Uzbek), <code>sv</code>(Swedish), <code>cs</code>(Czech), <code>he</code>(Hebrew), <code>id</code>(Indonesian), <code>tr</code>(Turkish), <code>uk</code>(Ukrainian), <code>nl</code>(Dutch), <code>pl</code>(Polish), <code>ar</code>(Arabic), <code>fa</code>(Persian), <code>it</code>(Italian), <code>zh</code>(Chinese), <code>ru</code>(Russian), <code>es</code>(Spanish), <code>ja</code>(Japanese), <code>de</code>(German), <code>fr</code>(French), <code>en</code>(English) |- |<code>rev_id</code> {{Required}} | The revision id for the wiki identified by the <code>lang</code> parameter. |} == Responses == {| class="wikitable responses" |- !200 | Success: Returns a [[Lift Wing API/Reference/Revert risk score object|Revert risk score object]]. {{Response start}} <syntaxhighlight lang="json"> { "model_name":"revertrisk-multilingual", "model_version":"3", "wiki_db":"enwiki", "revision_id":123456, "output":{ "prediction":false, "probabilities":{ "true":0.3058536847305622, "false":0.6941463152694378 } } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:11}} 7ko9hfp81pugofxyse3se7sp31ocj6x Lift Wing API/Reference/Revert risk score object 0 255 2353 1864 2026-06-11T15:23:24Z APaskulin (WMF) 20 Add banner pointing to new docs location 2353 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> The revert risk score represents the result of executing a Revert risk model with a specific language code and wiki revision ID. == Example == <syntaxhighlight lang="json"> { "model_name": "revertrisk-language-agnostic", "model_version": "1", "wiki_db": "enwiki", "revision_id": 123456, "output": { "prediction": false, "probabilities": { "true": 0.3058536847305622, "false": 0.6941463152694378 } } } </syntaxhighlight> == Schema == {| class="wikitable properties" |<code>model_name</code> {{Required string}} | The model that generated the output. Example "revertrisk-language-agnostic". |- |<code>model_version</code> {{Required string}} | The version of the model being used. Example "1". |- |<code>wiki_db</code> {{Required string}} | String identifying the target Wiki. Example: "enwiki". |- |<code>revision_id</code>{{Required integer}} | Integer representing the Wiki revision id. Example: 123456. |- |<code>prediction</code>{{Required boolean}} | Boolean decision result. Example: true. |- |<code>probabilities</code> {{Required}}{{tag|map}} | Map structure representing the predicted probability of being reverted and NOT reverted. |} __NOTOC__ {{DEFAULTSORT:3}} 8vx4t0bscrrswbdft70428uemi73zss Lift Wing API 0 330 2379 1778 2026-06-11T15:27:01Z APaskulin (WMF) 20 Add banner pointing to new docs location 2379 wikitext text/x-wiki Use machine learning to make predictions about pages and edits. {| class="wikitable" style="width:100%" !style="font-size:14px; width:20%;"|Status |style="font-size:14px"|{{Tag|Documentation has been moved to [[Wikitech:Machine_Learning/LiftWing/API]].|#fee7e6}} |- !style="font-size:14px"|Access |style="font-size:14px"|{{Tag|public|#d5fdf4}} |- !style="font-size:14px"|Projects and languages |style="font-size:14px"| limited projects and languages (See the [[Lift Wing API/Reference|API reference]].) |- !style="font-size:14px"|Framework |style="font-size:14px"|REST |} <div class="container"> <div class="row" style="padding-top:20px; padding-bottom:30px;"> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0;"> <div class="card-body"> <p class="card-title" style="font-weight:600;text-align:center;">[[Lift Wing API/Reference|API reference]]</p> </div> </div> </div> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0;"> <div class="card-body"> <p class="card-title" style="font-weight:600;text-align:center;">[[Authentication|Access policy]]</p> </div> </div> </div> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0;"> <div class="card-body"> <p class="card-title" style="font-weight:600;text-align:center;">[[Lift Wing API/Rate limits|Rate limits]]</p> </div> </div> </div> <div class="col-sm"> <div class="card" style="background: #f8f9fa; border: 1px solid #eaecf0;"> <div class="card-body"> <p class="card-title" style="font-weight:600;text-align:center;">[[Stability policy]]</p> </div> </div> </div> </div> </div> == Sample call == {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-articlequality:predict -X POST -d '{"rev_id": 12345}'|comment=Get a score from the Revscoring Article Quality model for the revision 12345 of English Wikipedia.}} == Topics == * [[Tools and bots]] * [[Security]] == How to report a bug == Create an account on [[mw:Special:MyLanguage/Phabricator/Help|Wikimedia Phabricator]], and tag the task with [[phab:tag/Lift-Wing|Lift-Wing]]. == How to get help == Leave a comment on the [[{{TALKPAGENAME}}|discussion page]]. == How to edit the docs == Visit the [[Community/Contributing|contributing guide]] to get started editing the API Portal. == Changelog == {| |style="width: 25%; vertical-align: top;"| '''March 20, 2023''' | The Lift Wing API is now available through api.wikimedia.org.<br><br><br> |- |} __NOTOC__ l2pkp9nuropt612q2onevggwhru376y Lift Wing API/Reference/Get readability prediction 0 400 2369 2093 2026-06-11T15:26:03Z APaskulin (WMF) 20 Add banner pointing to new docs location 2369 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/readability:predict|method=POST|color=#14866d|color2=#d5fdf4}} The model generates scores to assess the readability of Wikipedia articles. The readability score is a rough proxy to capture how difficult it is for a reader to understand the text of the article. Check the [[meta:Machine_learning_models/Proposed/Multilingual_readability_model_card|model card]] for more info. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/readability:predict -X POST -d '{"rev_id": 123456, "lang": "en"}' -H "Content-type: application/json"|comment=Get the readability score for the edit on English Wikipedia identified by the revision id 123456.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/readability:predict -X POST -d '{"rev_id": 123456, "lang": "en"}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" |comment=Get the readability score for the edit on English Wikipedia identified by the revision id 123456.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get the readability score for the edit on English Wikipedia identified by the revision id 123456. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/readability:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 123456, "lang": "en"} response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get the readability score for the edit on English Wikipedia identified by the revision id 123456. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/readability:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 123456, "lang": "en"}; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == POST Parameters == {| class="wikitable properties" |<code>lang</code> {{Required}} | A string representing the language code related to the target wiki. Example: "en" for English Wikipedia. Supported languages: 'af', 'sq', 'am', 'ar', 'hy', 'as', 'az', 'eu', 'be', 'bn', 'bs', 'br', 'bg', 'my', 'ca', 'zh-yue', 'zh', 'zh-classical', 'hr', 'cs', 'da', 'nl', 'en', 'eo', 'et', 'tl', 'fi', 'fr', 'gl', 'ka', 'de', 'el', 'gu', 'ha', 'he', 'hi', 'hu', 'is', 'id', 'ga', 'it', 'ja', 'jv', 'kn', 'kk', 'km', 'ko', 'ku', 'ky', 'lo', 'la', 'lv', 'lt', 'mk', 'mg', 'ms', 'ml', 'mr', 'mn', 'ne', 'no', 'or', 'om', 'ps', 'fa', 'pl', 'pt', 'pa', 'ro', 'ru', 'sa', 'gd', 'sr', 'sd', 'si', 'sk', 'sl', 'so', 'es', 'su', 'sw', 'sv', 'ta', 'te', 'th', 'tr', 'uk', 'ur', 'ug', 'uz', 'vi', 'cy', 'fy', 'xh', 'yi', 'simple' |- |<code>rev_id</code> {{Required}} | The revision id for the wiki identified by the <code>lang</code> parameter. |} == Responses == {| class="wikitable responses" |- !200 | Success: Returns a [[Lift Wing API/Reference/Readability score object|readability score object]]. {{Response start}} <syntaxhighlight lang="json"> { "model_name": "readability", "model_version": "4", "wiki_db": "enwiki", "revision_id": 123456, "output": { "score": -0.29161882400512695, "fk_score_proxy": 8.63213539862886 } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:14}} 6l43ruog34xb9teyhgn6fty9b0yemsz Lift Wing API/Reference/Readability score object 0 401 2356 2094 2026-06-11T15:23:36Z APaskulin (WMF) 20 Add banner pointing to new docs location 2356 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> The readability score represents the result of executing a Readability model with a specific language code and wiki revision ID. == Example == <syntaxhighlight lang="json">{ "model_name": "readability", "model_version": "4", "wiki_db": "enwiki", "revision_id": 123456, "output": { "score": -0.29161882400512695, "fk_score_proxy": 8.63213539862886 } }</syntaxhighlight> == Schema == {| class="wikitable properties" |<code>model_name</code> {{Required string}} | The model that generated the output. |- |<code>model_version</code> {{Required string}} | The version of the model being used. |- |<code>wiki_db</code> {{Required string}} | String identifying the target Wiki. |- |<code>revision_id</code>{{Required integer}} | Integer representing the Wiki revision id. |- |'''score''' {{Required}}{{tag|float}} | The readability score provided by the ranking model (can be used to compare articles between each other). |- |<code>fk_score_proxy</code> {{Required}}{{tag|float}} | Flesch–Kincaid score approximation. |} __NOTOC__ {{DEFAULTSORT:3.5}} mye5pexa8ns50z2sxfld3ja4ikc5aan Lift Wing API/Reference/Get language identification prediction 0 402 2370 2084 2026-06-11T15:26:07Z APaskulin (WMF) 20 Add banner pointing to new docs location 2370 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/langid:predict|method=POST|color=#14866d|color2=#d5fdf4}} The model generates scores to assess the language of the text provided as input. Check the [[meta:Machine_learning_models/Proposed/Language_Identification|model card]] for more info. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/langid:predict -X POST -d '{"text": "Some sample text in any language that we want to identify"}' -H "Content-type: application/json"|comment=Anonymous request}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/langid:predict -X POST -d '{"text": "Some sample text in any language that we want to identify"}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" ||comment=Authenticated request using Bearer token}} === Python === <syntaxhighlight lang="python"> # Python 3 import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/langid:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"text": "Some sample text in any language that we want to identify"} response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/langid:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"text": "Some sample text in any language that we want to identify"}; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == POST Parameters == {| class="wikitable properties" |<code>text</code> {{Required}} | A string that contains the text which we want to identify the language it is written in. |} == Responses == {| class="wikitable responses" |- !200 | Success: Returns a language identification object. {| class="wikitable properties" |<code>language</code> | The language code as returned by the model. Supported languages: |- |<code>wikicode</code> | The language code in [https://en.wikipedia.org/wiki/ISO_639-1 ISO 639-1] format as used in wiki projects. <code>ace</code> <code>acm</code> <code>acq</code> <code>aeb</code> <code>af</code> <code>ajp</code> <code>sq</code> <code>am</code> <code>ar</code> <code>ary</code> <code>arz</code> <code>as</code> <code>ast</code> <code>awa</code> <code>ay</code> <code>azb</code> <code>az</code> <code>ba</code> <code>bm</code> <code>ban</code> <code>be</code> <code>bem</code> <code>bn</code> <code>bh</code> <code>bjn</code> <code>bo</code> <code>bs</code> <code>bug</code> <code>bg</code> <code>ca</code> <code>ceb</code> <code>cs</code> <code>cjk</code> <code>ckb</code> <code>crh</code> <code>cy</code> <code>da</code> <code>de</code> <code>din</code> <code>dyu</code> <code>dz</code> <code>el</code> <code>en</code> <code>eo</code> <code>et</code> <code>eu</code> <code>ee</code> <code>fo</code> <code>fj</code> <code>fi</code> <code>fon</code> <code>fr</code> <code>fur</code> <code>ff</code> <code>om</code> <code>gd</code> <code>ga</code> <code>gl</code> <code>gn</code> <code>gu</code> <code>ht</code> <code>ha</code> <code>he</code> <code>hi</code> <code>hne</code> <code>hr</code> <code>hu</code> <code>hy</code> <code>ibo</code> <code>ilo</code> <code>id</code> <code>is</code> <code>it</code> <code>jv</code> <code>ja</code> <code>kab</code> <code>kac</code> <code>kam</code> <code>kn</code> <code>ks</code> <code>ka</code> <code>kk</code> <code>kbp</code> <code>kea</code> <code>mn</code> <code>kh</code> <code>ki</code> <code>rw</code> <code>ky</code> <code>kmb</code> <code>ku</code> <code>kg</code> <code>ko</code> <code>lo</code> <code>lij</code> <code>li</code> <code>ln</code> <code>lt</code> <code>lmo</code> <code>ltg</code> <code>lb</code> <code>lua</code> <code>lg</code> <code>luo</code> <code>lu</code> <code>lvs</code> <code>mag</code> <code>mai</code> <code>ml</code> <code>mr</code> <code>min</code> <code>mk</code> <code>mt</code> <code>mni</code> <code>mos</code> <code>mi</code> <code>my</code> <code>nl</code> <code>nn</code> <code>no</code> <code>ne</code> <code>nso</code> <code>nus</code> <code>ny</code> <code>oc</code> <code>or</code> <code>pag</code> <code>pa</code> <code>pap</code> <code>ps</code> <code>fa</code> <code>mg</code> <code>pl</code> <code>pt</code> <code>qu</code> <code>ro</code> <code>rn</code> <code>ru</code> <code>sg</code> <code>sa</code> <code>sat</code> <code>shn</code> <code>si</code> <code>sk</code> <code>sl</code> <code>sm</code> <code>sn</code> <code>sd</code> <code>so</code> <code>st</code> <code>es</code> <code>sc</code> <code>sr</code> <code>ss</code> <code>su</code> <code>sv</code> <code>sw</code> <code>szl</code> <code>ta</code> <code>tt</code> <code>te</code> <code>tg</code> <code>tl</code> <code>th</code> <code>ti</code> <code>tp</code> <code>tn</code> <code>ts</code> <code>tk</code> <code>tum</code> <code>tr</code> <code>tw</code> <code>tzm</code> <code>ug</code> <code>uk</code> <code>umb</code> <code>ur</code> <code>uz</code> <code>vec</code> <code>vi</code> <code>war</code> <code>wo</code> <code>xh</code> <code>yi</code> <code>yo</code> <code>zh</code> <code>ms</code> <code>zu</code> |- |<code>languagename</code> | The name of the language in English. |- |<code>score</code> | Score represents a probability that represents the confidence of the model for the current prediction. |- {{Response start}} <syntaxhighlight lang="json"> { "language":"eng_Latn", "wikicode":"en", "languagename":"English", "score":0.4073379337787628 } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:15}} jdcnn5juwg1fsge48zue2l00wzny6gu Lift Wing API/Reference/Get content translation recommendations 0 406 2372 1954 2026-06-11T15:26:21Z APaskulin (WMF) 20 Add banner pointing to new docs location 2372 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/recommendation/v1/api/|method=GET|color=#14866d|color2=#d5fdf4}} The service recommends articles to translate from one language to another. Check the [https://meta.wikimedia.org/wiki/Recommendation_API#Translation documentation] for more info. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url="https://api.wikimedia.org/service/lw/recommendation/v1/api/?s=en&t=fr&n=3&article=Apple"|comment=Anonymous request}} ==== Logged in access ==== {{Curl|url="https://api.wikimedia.org/service/lw/recommendation/v1/api/?s=en&t=fr&n=3&article=Apple" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" ||comment=Authenticated request using Bearer token}} === Python === <syntaxhighlight lang="python"> # Python 3 import json import requests use_auth = False inference_url = "https://api.wikimedia.org/service/lw/recommendation/v1/api/?s=en&t=fr&n=3&article=Apple" if use_auth: headers: { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "User-Agent": "YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)" } else: headers = {} response = requests.get(inference_url, headers=headers) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> const inferenceUrl = "https://api.wikimedia.org/service/lw/recommendation/v1/api/?s=en&t=fr&n=3&article=Apple"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Authorization": "Bearer " + accessToken, "User-Agent": appName + " ( " + email + " )" }); fetch(inferenceUrl, { method: "GET", headers: headers }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == Responses == {| class="wikitable responses" |- !200 | Success: Returns a content translation recommendations object. {{Response start}} <syntaxhighlight lang="json"> [ { "pageviews": 495, "title": "EverCrisp", "wikidata_id": "Q65057164", "rank": 499 }, { "pageviews": 114, "title": "Kaolin_spray", "wikidata_id": "Q6366155", "rank": 496 }, { "pageviews": 1455, "title": "Durio_zibethinus", "wikidata_id": "Q1135236", "rank": 493 } ] </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:15}} by7v703nkn6oayv5btv12f5gwjdzrro Lift Wing API/Reference/Get article descriptions 0 407 2375 2083 2026-06-11T15:26:33Z APaskulin (WMF) 20 Add banner pointing to new docs location 2375 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/article-descriptions:predict|method=POST|color=#14866d|color2=#d5fdf4}} The model generates a short description for the Wikipedia article provided as input. Check the [[meta:Machine_learning_models/Proposed/Article_descriptions|model card]] for more info. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/article-descriptions:predict -X POST -d '{"lang": "en", "title": "Clandonald", "num_beams": 2, "debug": 1}' -H "Content-type: application/json"|comment=Anonymous request}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/article-descriptions:predict -X POST -d '{"lang": "en", "title": "Clandonald", "num_beams": 2, "debug": 1}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" ||comment=Authenticated request using Bearer token}} === Python === <syntaxhighlight lang="python"> # Python 3 import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/article-descriptions:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"lang": "en", "title": "Clandonald", "num_beams": 2, "debug": 1} response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/article-descriptions:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"lang": "en", "title": "Clandonald", "num_beams": 2, "debug": 1}; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == POST Parameters == {| class="wikitable properties" |<code>lang</code> {{Required}} | The language code for the Wikipedia article. |- |<code>title</code> {{Required}} | The wikipedia article title. |- |<code>num_beams</code> {{Required}} | The number of beams. |- |<code>debug</code> {{Optional}} | Set debug mode on or off (i.e 1 or 0) |- |} == Responses == {| class="wikitable responses" |- !200 | Success: Returns an article descriptions object. {{Response start}} <syntaxhighlight lang="json"> { "lang": "en", "title": "Clandonald", "blp": false, "num_beams": 2, "groundtruth": "Hamlet in Alberta, Canada", "latency": { "wikidata-info (s)": 0.051393747329711914, "mwapi - first paragraphs (s)": 0.22525501251220703, "total network (s)": 0.2677001953125, "model (s)": 2.823765754699707, "total (s)": 3.091487407684326 }, "features": { "descriptions": { "fr": "hameau d'Alberta", "en": "hamlet in central Alberta, Canada" }, "first-paragraphs": { "en": "Clandonald is a hamlet in central Alberta, Canada within the County of Vermilion River. It is located approximately 28 kilometres (17 mi) north of Highway 16 and 58 kilometres (36 mi) northwest of Lloydminster.", "fr": "Clandonald est un hameau (hamlet) du Comté de Vermilion River, situé dans la province canadienne d'Alberta." } }, "prediction": [ "Hamlet in Alberta, Canada", "human settlement in Alberta, Canada" ] } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:18}} f5smsw7ygp8a40ukhzpx93ips8fu68n Lift Wing API/Reference/Get content translation recommendation 0 418 2373 2092 2026-06-11T15:26:25Z APaskulin (WMF) 20 Add banner pointing to new docs location 2373 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/recommendation/api/v1/translation|method=GET|color=#14866d|color2=#d5fdf4}} Get recommendations for articles to translate based on those that exist in a source language wiki but are missing from a target language wiki. Check this [https://api.wikimedia.org/service/lw/recommendation/api/docs interactive documentation] or try the usage examples below. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url="https://api.wikimedia.org/service/lw/recommendation/api/v1/translation?source=en&target=fr&count=3&seed=Apple" |comment=Get three recommendations of articles to translate to French based on the English Wikipedia Apple article.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get three recommendations of articles to translate to French based on the English Wikipedia Apple article. import requests inference_url = "https://api.wikimedia.org/service/lw/recommendation/api/v1/translation" params = {"source":"en", "target":"fr", "count":"3", "seed":"Apple"} response = requests.get(inference_url, params=params) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get three recommendations of articles to translate to French based on the English Wikipedia Apple article. */ let params = {"source":"en", "target":"fr", "count":"3", "seed":"Apple"}; const inferenceUrl = new URL('https://api.wikimedia.org/service/lw/recommendation/api/v1/translation'); inferenceUrl.search = new URLSearchParams(params); fetch(inferenceUrl) .then(response => response.json()) .then(data => console.log(data)) </syntaxhighlight> </div> == GET Parameters == {| class="wikitable properties" |<code>source</code> {{Required}} | source wiki language code (e.g. `en`) |- |<code>target</code> {{Required}} | target wiki language code (e.g. `fr`) |- |<code>count</code> {{Optional}} | number of recommendations to fetch (default `12`) |- |<code>seed</code> {{Optional}} | seed article for personalized recommendations. Can be a list of seeds separated by <nowiki>`|`</nowiki> |- |<code>topic</code> {{Optional}} | article topic for personalized recommendations. Can be a list of topics separated by <nowiki>`|`</nowiki> |- |<code>include_pageviews</code> {{Optional}} | whether to include pageview counts in the response (e.g `true`, `false`. default `false`) |- |<code>search_algorithm</code> {{Optional}} | which search algorithm to use (e.g `morelike`, `mostpopular`. default `morelike`) |- |<code>rank_method</code> {{Optional}} | which rank method to use (e.g `default`, `sitelinks`. default `default`) |- |} == Responses == {| class="wikitable responses" |- !200 | Success: Returns an content translation recommendation object. {{Response start}} <syntaxhighlight lang="json"> [ { "title": "Flamenco (apple)", "pageviews": 0, "wikidata_id": "Q19597233", "rank": 7, "langlinks_count": 1 }, { "title": "Applecrab", "pageviews": 0, "wikidata_id": "Q19595924", "rank": 8, "langlinks_count": 0 }, { "title": "Malus × zumi", "pageviews": 0, "wikidata_id": "Q5990804", "rank": 21, "langlinks_count": 3 } ] </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:17}} 4akdv9dmyz640dtq7xg1oh119jvixp5 Lift Wing API/Reference/Get language agnostic articlequality prediction 0 421 2371 2100 2026-06-11T15:26:17Z APaskulin (WMF) 20 Add banner pointing to new docs location 2371 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/articlequality:predict|method=POST|color=#14866d|color2=#d5fdf4}} The goal of this model is to predict/assess the quality of Wikipedia articles. Check the [[meta:Machine_learning_models/Proposed/Language-agnostic_Wikipedia_article_quality|model card]] for more info. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/articlequality:predict -X POST -d '{"rev_id": 123456, "lang": "en"}' -H "Content-type: application/json"|comment=Get the quality score for an article on English Wikipedia identified by the revision id 123456.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/articlequality:predict -X POST -d '{"rev_id": 123456, "lang": "en"}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" |comment=Get the quality score for an article on English Wikipedia identified by the revision id 123456.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get the quality score for an article on English Wikipedia identified by the revision id 123456. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/articlequality:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 123456, "lang": "en"} response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get the quality score for an article on English Wikipedia identified by the revision id 123456. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/articlequality:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 123456, "lang": "en"}; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == POST Parameters == {| class="wikitable properties" |<code>lang</code> {{Required}} | A string representing the language code related to the target wiki. Example: "en" for English Wikipedia. |- |<code>rev_id</code> {{Required}} | The revision id for the wiki identified by the <code>lang</code> parameter. |- |<code>extended_output</code> |Whether or not the response should include the extended output of the model. Either true or false. Default: false The extended output includes the feature values used during inference as well as the output label. |} == Responses == {| class="wikitable responses" |- !200 | Success: Returns a [[API reference/Service/Lift Wing/Articlequality Score object|Articlequality Score object]]. {{Response start}} <syntaxhighlight lang="json"> { "model_name": "articlequality", "model_version": "1", "wiki_db": "enwiki", "revision_id": 123456, "score": 0.10748992767177634, "features": { "raw": { "characters": 625, "refs": 0, "wikilinks": 8, "categories": 0, "media": 0, "headings": 0, "sources": 0, "infobox": false, "messagebox": false }, "normalized": { "characters": 0.2589179540286342, "refs": 0.0, "wikilinks": 0.2710334973090758, "categories": 0.0, "media": 0.0, "headings": 0.0, "sources": 0.0, "infobox": false, "messagebox": false } } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:12}} mlhelw93m74kghr2czysb7wrt9sgjdv Lift Wing API/Reference/Get article country 0 425 2376 2142 2026-06-11T15:26:38Z APaskulin (WMF) 20 Add banner pointing to new docs location 2376 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/article-country:predict|method=POST|color=#14866d|color2=#d5fdf4}} The article-country inference service uses a Wikipedia article title and the language it was written in to determine which countries are relevant to this article. Check the [[meta:Machine_learning_models/Proposed/Article_country|model card]] for more info. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/article-country:predict -X POST -d '{"lang": "en", "title": "Toni_Morrison"}' -H "Content-type: application/json"|comment=Anonymous request}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/article-country:predict -X POST -d '{"lang": "en", "title": "Toni_Morrison"}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" ||comment=Authenticated request using Bearer token}} === Python === <syntaxhighlight lang="python"> # Python 3 import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/article-country:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"lang": "en", "title": "Toni_Morrison"} response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/article-country:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"lang": "en", "title": "Toni_Morrison"}; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == POST Parameters == {| class="wikitable properties" |<code>lang</code> {{Required}} | The language code for the Wikipedia article. |- |<code>title</code> {{Required}} | The wikipedia article title. |- |} == Responses == {| class="wikitable responses" |- !200 | Success: Returns an article country object. {{Response start}} <syntaxhighlight lang="json"> { "model_name": "article-country", "model_version": "1", "prediction": { "article": "https://en.wikipedia.org/wiki/Toni_Morrison", "wikidata_item": "Q72334", "results": [ { "country": "United States", "score": 1, "source": { "wikidata_properties": [ { "P27": "country of citizenship" } ], "categories": [ "Category:21st-century American women writers" ], "links": [ { "country": "United States", "count": 248, "prop-tfidf": 0.62813970327334 } ] } } ] } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:19}} kbev2epgs1d4la20wi997rasq09dfx7 Lift Wing API/Reference/Get reference need prediction 0 427 2368 2132 2026-06-11T15:25:59Z APaskulin (WMF) 20 Add banner pointing to new docs location 2368 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/reference-need:predict|method=POST|color=#14866d|color2=#d5fdf4}} This model uses revision content to predict the reference need score of that revision. Check the [[meta:Machine_learning_models/Proposed/Multilingual_reference_need|model card]] for more info. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/reference-need:predict -X POST -d '{"rev_id": 123456, "lang": "en"}'|comment=Get the reference need score for the edit on English Wikipedia identified by the revision id 123456.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/reference-need:predict -X POST -d '{"rev_id": 123456, "lang": "en"}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" |comment=Get the reference need score for the edit on English Wikipedia identified by the revision id 123456.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get the reference need score for the edit on English Wikipedia identified by the revision id 123456. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/reference-need:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 123456, "lang": "en"} response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get the reference need score for the edit on English Wikipedia identified by the revision id 123456. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/reference-need:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 123456, "lang": "en"}; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == POST Parameters == {| class="wikitable properties" |<code>lang</code> {{Required}} | A string representing the language code related to the target wiki. Example: "en" for English Wikipedia. |- |<code>rev_id</code> {{Required}} | The revision id for the wiki identified by the <code>lang</code> parameter. |} == Responses == {| class="wikitable responses" |- !200 | Success: Returns a [[Lift Wing API/Reference/Reference_need_score_object|Reference need score object]]. {{Response start}} <syntaxhighlight lang="json"> { "model_name":"reference-need", "model_version":0, "wiki_db":"enwiki", "revision_id":1242378206, "reference_need_score":0.16666666666666666 } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:12}} ik67zt8sef7l73c6y1eopj1g8o5h4wt Lift Wing API/Reference/Get reference risk prediction 0 428 2367 2135 2026-06-11T15:25:55Z APaskulin (WMF) 20 Add banner pointing to new docs location 2367 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/reference-risk:predict|method=POST|color=#14866d|color2=#d5fdf4}} This model uses edit history metadata to predict the likelihood of a reference to survive on a Wikipedia article. Check the [[meta:Machine_learning_models/Proposed/Language-agnostic_reference_risk|model card]] for more info. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/reference-risk:predict -X POST -d '{"rev_id": 1242378206, "lang": "en"}'|comment=Get the reference risk score for the edit on English Wikipedia identified by the revision id 1242378206.}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/reference-risk:predict -X POST -d '{"rev_id": 1242378206, "lang": "en"}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" |comment=Get the reference risk score for the edit on English Wikipedia identified by the revision id 1242378206.}} === Python === <syntaxhighlight lang="python"> # Python 3 # Get the reference risk score for the edit on English Wikipedia identified by the revision id 1242378206. import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/reference-risk:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 1242378206, "lang": "en"} response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> /* Get the reference risk score for the edit on English Wikipedia identified by the revision id 1242378206. */ const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/reference-risk:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 1242378206, "lang": "en"}; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == POST Parameters == {| class="wikitable properties" |<code>lang</code> {{Required}} | A string representing the language code related to the target wiki. Example: "en" for English Wikipedia. |- |<code>rev_id</code> {{Required}} | The revision id for the wiki identified by the <code>lang</code> parameter. |- |<code>extended_output</code> {{Optional}}{{tag|boolean}} | Returns a list of additional reference metadata for each reference when set to True. |} == Responses == {| class="wikitable responses" |- !200 | Success: Returns a [[Lift Wing API/Reference/Reference_risk_score_object|Reference risk score object]]. {{Response start}} <syntaxhighlight lang="json"> { "model_name":"reference-risk", "model_version":"2024-07", "wiki_db":"enwiki", "revision_id":1242378206, "reference_count":307, "survival_ratio":{ "min":0.6917214573238013, "mean":0.830631414204165, "median":0.8305581162142753 }, "reference_risk_score":0.0 } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:12}} pe3junwvdzfxu9p9mo69j3si5bkmsr6 Lift Wing API/Reference/Reference need score object 0 429 2355 2129 2026-06-11T15:23:32Z APaskulin (WMF) 20 Add banner pointing to new docs location 2355 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> The reference need score represents the result of executing a Reference need model with a language code and wiki revision ID. == Example == <syntaxhighlight lang="json"> { "model_name": "reference-need", "model_version": 0, "wiki_db": "enwiki", "revision_id": 1242378206, "reference_need_score": 0.16666666666666666 } </syntaxhighlight> == Schema == {| class="wikitable properties" |<code>model_name</code> {{Required string}} | The model that generated the output. |- |<code>model_version</code> {{Required integer}} | The version of the model being used. |- |<code>wiki_db</code> {{Required string}} | String identifying the target Wiki. |- |<code>revision_id</code>{{Required integer}} | Integer representing the Wiki revision id. |- |<code>reference_need_score</code>{{Required}}{{tag|float}} | The reference need score of that revision. |} __NOTOC__ {{DEFAULTSORT:3}} qxfgdk14lbgbfm3hd0whe3tm5j4kd8x Lift Wing API/Reference/Reference risk score object 0 430 2354 2134 2026-06-11T15:23:28Z APaskulin (WMF) 20 Add banner pointing to new docs location 2354 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> The reference risk score represents the result of executing a Reference risk model with a language code and wiki revision ID. == Example == <syntaxhighlight lang="json"> { "model_name": "reference-risk", "model_version": "2024-07", "wiki_db": "enwiki", "revision_id": 1242378206, "reference_count": 307, "survival_ratio": { "min": 0.6917214573238013, "mean": 0.830631414204165, "median": 0.8305581162142753 }, "reference_risk_score": 0.0, "references": [ { "url": "https://coasterforce.com/wild-mouse-steel/", "domain_name": "coasterforce.com", "domain_metadata": { "ps_label_local": null, "ps_label_enwiki": null, "survival_ratio": 0.6917214573238013, "page_count": 56, "editors_count": 40 } }, ... ] } </syntaxhighlight> == Schema == {| class="wikitable properties" |<code>model_name</code> {{Required string}} | The model that generated the output. |- |<code>model_version</code> {{Required string}} | The version of the model being used. For Reference risk, it is the snapshot of the precomputed domain metadata. |- |<code>wiki_db</code> {{Required string}} | String identifying the target Wiki. |- |<code>revision_id</code>{{Required integer}} | Integer representing the Wiki revision id. |- |<code>reference_count</code>{{Required integer}} | Number of URL-based references. |- |<code>survival_ratio</code> {{Required}}{{tag|map}} | Map structure of minimum, mean, and median survival edit ratio of cited domains. |- |<code>reference_risk_score</code>{{Required}}{{tag|float}} | Proportion of deprecated and blacklisted domains. |- |<code>references</code>{{Optional}}{{tag|list}} | List of URL-based references. The model outputs the following features per such reference: {| class="wikitable" |+ |<code>'''url'''</code>{{Required string}} |Parsed URL |- |<code>'''domain_name'''</code>{{Required string}} |Domain extracted from the URL |- |<code>'''domain_metadata'''</code>{{Required}}{{tag|map}} |'''ps_label_local''': Classification of the domain in the local perennial sources list (if any). '''ps_label_enwiki''': Classification of the domain in the English perennial sources list (if any). '''survival_ratio ''': Survival edit ratio (survival), i.e., the proportion of survived edits since domain addition. '''page_count''': in how many pages in a corresponding wiki the domain was added. '''editors_count''': how many distinct editors in a corresponding wiki cited the domain. |} |} __NOTOC__ {{DEFAULTSORT:3}} emeku48djw349po1mp9joqju62q5l19 Lift Wing API/Reference/Get revertrisk wikidata 0 436 2364 2181 2026-06-11T15:24:52Z APaskulin (WMF) 20 Add banner pointing to new docs location 2364 wikitext text/x-wiki <div style="background-color: #fee7e6; padding: 8px 10px; margin-top:10px;"> <p style="margin-bottom:0;"> ↳&nbsp;&nbsp;<span style="font-weight:600;">Redirect</span><br> <span>This documentation has moved to the [https://wikitech.wikimedia.org/w/index.php?api=lift-wing&title=Special%3ARestSandbox REST Sandbox on Wikitech].</span> </p> </div> {{Endpoint|endpoint=/service/lw/inference/v1/models/revertrisk-wikidata:predict|method=POST|color=#14866d|color2=#d5fdf4}} The revertrisk-wikidata inference service uses the metadata and content of a Wikidata article revision ID to predict the risk of this revision being reverted. See [[meta:Machine_learning_models/Production/RevertRisk_Wikidata|model card]] for more info. == Examples == <div class="mw-gadget-tabbedwindow"> === curl === ==== Anonymous access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-wikidata:predict -X POST -d '{"rev_id": 1945516043}' -H "Content-type: application/json"|comment=Anonymous request}} ==== Logged in access ==== {{Curl|url=https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-wikidata:predict -X POST -d '{"rev_id": 1945516043}' -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-type: application/json" ||comment=Authenticated request using Bearer token}} === Python === <syntaxhighlight lang="python"> # Python 3 import json import requests use_auth = False inference_url = 'https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-wikidata:predict' if use_auth: headers = { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'User-Agent': 'YOUR_APP_NAME (YOUR_EMAIL_OR_CONTACT_PAGE)', 'Content-type': 'application/json' } else: headers = {} data = {"rev_id": 1945516043} response = requests.post(inference_url, headers=headers, data=json.dumps(data)) print(response.json()) </syntaxhighlight> === JavaScript === <syntaxhighlight lang="javascript"> const inferenceUrl = "https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-wikidata:predict"; const accessToken = "YOUR_ACCESS_TOKEN"; const appName = "YOUR_APP_NAME"; const email = "YOUR_EMAIL_OR_CONTACT_PAGE"; let headers = new Headers({ "Content-Type": "application/json", "Authorization": "Bearer " + accessToken, "Api-User-Agent": appName + " ( " + email + " )" }); let data = {"rev_id": 1945516043}; fetch(inferenceUrl, { method: "POST", headers: headers, body: JSON.stringify(data) }) .then(response => response.json()) .then(inferenceData => console.log(inferenceData)); </syntaxhighlight> </div> == POST Parameters == {| class="wikitable properties" |<code>rev_id</code> {{Required}} | The revision id of a Wikidata article. |- |} == Responses == {| class="wikitable responses" |- !200 | Success: Returns an revertrisk wikidata object. {{Response start}} <syntaxhighlight lang="json"> { "model_name": "revertrisk-wikidata", "model_version": "2", "revision_id": 1945516043, "output": { "prediction": false, "probabilities": { "true": 0.2718899239377954, "false": 0.7281100760622046 } } } </syntaxhighlight> {{Response end}} |} __NOTOC__ {{DEFAULTSORT:20}} gxj0bly26ufg5xqfh3lq4o7kw3uk85q