-
Notifications
You must be signed in to change notification settings - Fork 0
API Development & Wikidata API
API stands for Application Programming Interface. It is a set of rules and protocols that allow one software application to interact with another.
APIs play a crucial role in enabling isolated systems and software to work together.
-
RESTful APIs:
REST stands for Representational State Transfer. It uses standard HTTP methods such as GET, POST, DELETE, etc. Currently, RESTful APIs are the most popular type for web and mobile applications due to their simplicity and scalability.
-
GraphQL APIs:
GraphQL provides clients with the option to retrieve only the data they need, offering more flexibility than REST APIs. It is also more efficient and reduces over-fetching.
-
Authentication APIs:
Authentication APIs simplify the authentication and authorization process for applications.
-
Payment APIs:
APIs that provide a set of functions and methods for online payments. Developers can integrate online payment systems into their mobile or web applications. Examples include Stripe and PayPal APIs.
To utilize a REST Api, we should send request to server which serves the API we want to use. Let us dive deeper to api request:
A REST (Representational State Transfer) API request is typically composed of several componenst. Here are the key components of a REST API request:
-
Endpoint (URL):
- Definition: The URL that uniquely identifies the resource or service the client wants to interact with.
-
Example:
https://api.example.com/users
-
Example:
https://api.example.com/profile
-
Example:
https://api.example.com/items/493827
-
Example:
https://api.example.com/items?name=fridge&minPrice=2000
-
HTTP Method (Verb):
- Definition: Type of operation the client wants to perform on the resource. Common HTTP methods include GET, POST, PUT, PATCH, and DELETE.
-
Example:
GET
to retrieve data,POST
to create a data on the resource,PUT
orPATCH
to update an existing resource, andDELETE
to remove a resource.
-
Headers:
- Definition: Additional information sent with the request, typically in the form of key-value pairs. Headers can include authentication tokens, content types, and more.
-
Example:
Authorization: Bearer your_access_token (With this token, API can detect that client is authenticated so it performs the operations client asked.) Content-Type: application/json
-
Parameters (Query Parameters or Path Parameters):
- Definition: Additional data sent with the request to modify the request or filter the response. Parameters can be included in the URL (query parameters) or within the URL path (path parameters). API can internally resolve this path parameters and performs the operations based on this query parameters.
-
Example (Query Parameters):
https://api.example.com/users?role=admin (**Meaning: Get the users which have admin role)
-
Example (Path Parameters):
https://api.example.com/users/{id} (**Meaning: Get the user with the given id)
-
Request Body:
-
Definition: Contains data that the client wants to send to the server, typically used in
POST
,PUT
, andPATCH
requests. The format of the data (e.g., JSON or XML) is specified in theContent-Type
header. -
Example:
POST
Request that creates a new user:{ "username": "john_doe", "email": "[email protected]", "password": "secretpassword" }
-
Definition: Contains data that the client wants to send to the server, typically used in
-
Authentication:
- Definition: Information used to authenticate the client's identity. Common methods include API keys, OAuth tokens, or basic authentication.
-
Example: Using an API key:
Authorization: ApiKey your_api_key
These components define the main structure and purpose of the REST API requests. The server processes the requests based on these given components and returns an appropriate response.
Here are some examples of using REST API, using the JSONPlaceholder API , which is an extremely basic mock API built for testing and learning purposes. Each endpoints below will send GET
requests to the API. Click to see API responses for requests.
Get the comments belonging the post with id 1
- Wikidata is a free and collaborative knowledge base that can be edited by anyone, serving as a central repository for structured data.
- The Wikidata API allows developers to access and interact with the data stored in Wikidata programmatically.
- The official documentation for the Wikidata API can be found on the Wikimedia website.
- The Wikibase Rest API endpoint is
https://wikidata.org/w/rest.php/wikibase/v0
.
- The API provides methods to retrieve information about items, properties, queries, and more.
- One can retrieve data in various formats such as JSON, XML, and others.
- SPARQL (SPARQL Protocol and RDF Query Language) is commonly used to query Wikidata. SPARQL queries can be executed using the API.
- The MediaWiki Action API provides a way to access and interact with MediaWiki-powered wikis programmatically.
- Designed to allow developers to perform various actions, retrieve data, and manipulate content on MediaWiki wikis.
- Official documentation for the MediaWiki Action API is available on the MediaWiki website.
- The API endpoint is typically
https://www.mediawiki.org/w/api.php
.
- The API supports a range of actions, including fetching page content, editing pages, searching, and more.
- Some actions may require authentication, and OAuth is commonly used for secure access.
- Milestone 2 plan
- User Experience Decisions
- Milestone 1 Report
- Communication Plan
- Requirements
- Community Features
- Mock-Ups
- Sequence Diagram
- Class Diagram
- Use Case Diagram
- RAM - Tradeverse
- Project Plan - Tradeverse
- W3C Standard - Annotation
- 13.10.2024 -- Sixth Meeting
- 08.10.2024 -- Fifth Meeting
- 06.10.2024 -- Fourth Meeting
- 04.10.2024 -- Third Meeting
- 01.10.2024 -- Second Meeting
- 24.09.2024 -- First Meeting
💻 Lab Reports
👨🏽🤝👨🏾 User Group Scenarios
👨🏻💼👩🏻💼 User Scenarios
👤 Personal Pages
📝 Templates
Animal Trove Project
### 💻 Project- 1st Milestone Report
- 2nd Milestone Report
- 3rd Milestone Report
- Organization
- Requirements
- Elicitation Questions
- Scenerios
- Mockups
- Use Case Diagram
- Class Diagram
- Sequence Diagram
- RAM
- Project Plan
- User Tests
- Integration Tests
- Git Research
- Wikidata, Linked Data, SPARQL
- Web & Mobile Application Development
- API Development & Wikidata API
- Semantic Search
- Our Favorite Repositories