Wikipedia

Wikipedia

  • Category: Media


Introduction to MediaWiki API

MediaWiki is a free and open-source software wiki package written in PHP. The MediaWiki API is a collection of web services that allow developers to access and manipulate data from Wikimedia projects like Wikipedia, Wiktionary, Wikidata, etc. The API provides an interface for retrieving data from these projects in multiple formats like JSON, XML, and HTML. In this blog, we will explore the MediaWiki API and how to use it to access Wikimedia project data using JavaScript.

Getting Started

To use the MediaWiki API, you need to authenticate yourself by obtaining an API token. This token is used to identify your API requests and ensure that only authorized clients can access the API. To obtain an API token, you need to have an account on one of the Wikimedia projects.

Once you have an API token, you can start using the MediaWiki API by sending HTTP requests to the API endpoint. The API endpoint for the MediaWiki API is https://en.wikipedia.org/w/api.php, where en.wikipedia.org can be replaced with the name of any Wikimedia project.

Example Code

Here are some example API calls in JavaScript using the fetch() method:

Get page content by title

fetch('https://en.wikipedia.org/w/api.php?action=query&prop=extracts&titles=Albert%20Einstein&format=json')
    .then(response => response.json())
    .then(data => console.log(data.query.pages))
    .catch(error => console.error(error));

Search for page titles

fetch('https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=moon&format=json')
    .then(response => response.json())
    .then(data => console.log(data.query.search))
    .catch(error => console.error(error));

Get random page title

fetch('https://en.wikipedia.org/w/api.php?action=query&generator=random&grnnamespace=0&prop=info&inprop=url&grnlimit=1&format=json')
    .then(response => response.json())
    .then(data => console.log(data.query.pages))
    .catch(error => console.error(error));

The fetch() method sends a GET request to the specified API endpoint. The then() method processes the response and logs the resulting data to the console.

Conclusion

The MediaWiki API is a powerful tool for accessing data from Wikimedia projects. With the help of JavaScript and the fetch() method, you can easily interact with the API and retrieve the data you need. This blog has covered only a few of the many features and capabilities of the MediaWiki API, so be sure to check out the API documentation for more information.

Visit to Wikipedia website

Similar APIs of Media

DeepL API

DeepL API

Media

The DeepL API provides programmatic access to DeepL’s machine translation technology, making it possible to bring high quality translation capabilities directly to your websites and applications.

translationdeepl

Svrf – Face Filters

Svrf – Face Filters

Media

Let your users search and experience the largest database of immersive face filters, 360 videos, and 360 photos. The Svrf API is free to use across all types of apps: camera, messaging, chat, dating, creation, community, and more. The Svrf API allows you to supercharge your project or app with the first and largest search engine for immersive experiences. We make it simple for any developer to incorporate highly immersive experiences with all kinds of applications: augmented reality, virtual reality, mixed reality, mobile, and web. The Svrf API is RESTful and communicates using JSON. We support CORS, allowing you to access immersive experiences indexed by Svrf on your own web domains. We also provide a variety of resolutions, projections, and file formats to support most modern clients.

filtercameraentertainment

Meme Generator API

Meme Generator API

Media

Generate memes with a simple link! The api allows to input text on top and bottom places of the images. The images are selected from the api's website. You can create amazing fun apis through api meme.

memesjokesfun

Lolwallpapers API

Lolwallpapers API

Media

League of Legends Wallpapers website official API. This is a lightweight public API which provides an easy way to fetch informations about any wallpapers on LoLWallpapers.The current API version is ALPHA. This means that it can be unstable and could be slow sometimes. This version may not contain all of the features that are planned for the final version.

wallpapersphotoimages

Trace.moe API

Trace.moe API

Media

Trace back the scene where an anime screenshots is taken from. It tells you which anime, which episode, and the exact moment this scene appears.

animefiltersearch

Reelgood

Reelgood

Media

Reelgood takes all the various movies and TV shows that have ever been made (almost) and tells you where you can watch them, from subscription services (like Netflix and Prime Video) to free services (like Crackle, TubiTV and others) to TV everywhere options (like FX, ABC, and FOX) to rental and purchase options (like iTunes, Amazon, and Vudu.) Beyond simply searching and finding, we also take all the various services you have access to and can combine them into a single browsable, searchable and trackable interface. Trackable? Yes, trackable. With Reelgood we invite you to track your favorite shows or shows you want to see so that you can always pick up where you left off or wait until the show you're watching is available on a service you use. Think of us as the one place you need to go to start streaming on your laptop, desktop, tablet or mobile device. We even have a tvOS app for your AppleTV. We are every streaming service in one app so you can stop checking all your various services and simply check Reelgood whenever you're ready to watch.

genrereleaselive

Identity Protection Suite: Image & video redaction

Identity Protection Suite: Image & video redaction

Media

brighter AI’s Identity Protection Suite (IPS) offers various solutions to automatically redact faces and license plates on images and videos with highest quality. Protect personally identifiable information in images and videos against identification through facial or license plate recognition software and comply with data privacy regulations. Anonymize image and video material without losing compatibility with analytics and machine learning through our unique DNAT solution. Speed up public data collection and data sharing across domains, such as autonomous driving, video analytics, labelling, and video management systems.

VideoImageFace

TrailerAddict

TrailerAddict

Media

The TrailerAddict API was created for website publishers looking to easily embed trailers from TrailerAddict with variables under their control. Variables such as width, offset, trailer count, trailers by which film and more. The API responds with XML content. So some type of XML parses will be necessary to use the results provided.

trailermoviesfree

New York Times Movie Reviews

New York Times Movie Reviews

Media

Search New York Times movie reviews by keyword and opening date and filter by Critics' Picks. The API allows you to filter content with respect to Critics, Links, MultiMedia and NewYork times Reviews.

reviewsmoviesapi

ErosNow API

ErosNow API

Media

ErosNow is Bollywood multi-platform movie streaming platform. The ErosNow Partner APITrack this API returns data about Bollywood films, music, tracks, original episodes, live channel, active purchases, playlists, top charts, and TV shows.

erosnowapi