|
| 1 | +# History |
| 2 | + - **How**: |
| 3 | + - The history of APIs (Application Programming Interfaces) began as software systems needed a way to communicate with one another across different platforms. The term "API" started gaining traction in the 1960s but gained significant importance with the rise of web services. |
| 4 | + - The first major API interfaces were introduced in the 1990s with companies offering software platforms and web-based services. As the internet grew, APIs became a standard for remote communication. |
| 5 | + - REST APIs (Representational State Transfer) became popular in the early 2000s, with Roy Fielding's dissertation in 2000 laying the foundational principles. |
| 6 | + - Today, APIs are used extensively across the internet for a variety of purposes, including web services, third-party integrations, and mobile apps. |
| 7 | + - |
| 8 | + - **Who**: |
| 9 | + - **Roy Fielding**: Credited with popularizing RESTful APIs in his 2000 doctoral dissertation. |
| 10 | + - **Jeff Bezos**: Amazon was one of the first companies to make its services available via API in the early 2000s, driving the growth of cloud computing. |
| 11 | + - **Mark Zuckerberg**: The Facebook API, introduced in 2006, allowed developers to create applications that integrated with the platform, significantly growing the ecosystem. |
| 12 | + - **Google**: Pioneered API offerings such as Google Maps API and Google Maps Geocoding API, which helped set the stage for location-based service APIs. |
| 13 | + - |
| 14 | + - **Why**: |
| 15 | + - APIs were created to streamline communication between different software systems, enabling developers to build more sophisticated applications that could interact with other platforms, services, and databases. |
| 16 | + - The rise of mobile apps, microservices, cloud computing, and the need for scalability has made APIs a central part of modern software development. |
| 17 | + - APIs enable businesses to monetize their services and data by offering them as services to third-party developers (e.g., APIs for payment processing, social media sharing, etc.). |
| 18 | +- |
| 19 | +- # Introduction |
| 20 | + - ## Advantages: |
| 21 | + - Rate Limiting**: Limits on how often an API can be accessed to prevent overuse or abuse. This is often handled via HTTP headers like `X-RateLimit-Limit`. |
| 22 | + - **OAuth & Authentication**: APIs often require authentication methods like API keys, OAuth 2.0, or JWT for secure access. |
| 23 | + - **Caching**: Using headers like `Cache-Control` to reduce unnecessary calls to the server and improve performance. |
| 24 | + - **Webhooks & Event-Driven APIs**: Webhooks allow an API to push data to a client or server when a certain event occurs (e.g., a new user registers on a platform). |
| 25 | + - **Versioning**: Managing different versions of an API to ensure backward compatibility for consumers of the API. |
| 26 | + - |
| 27 | + - ## Disadvantages: |
| 28 | + - **Complex Authentication**: Some APIs require complex token systems or OAuth for security, which may increase integration complexity. |
| 29 | + - **Rate Limiting**: APIs may restrict the number of requests in a time period, making it harder for applications to handle bursts of traffic. |
| 30 | + - **Deprecation & Versioning Issues**: As APIs evolve, older versions may be deprecated, requiring consumers to upgrade their systems. |
| 31 | + - **Latency**: Remote APIs might have latency issues depending on the network connection, impacting the responsiveness of an application. |
| 32 | +- |
| 33 | +- # Notes |
| 34 | + - ## Types of APIs: |
| 35 | + - **REST (Representational State Transfer)**: A stateless, lightweight protocol commonly used in web services. It uses standard HTTP methods (GET, POST, PUT, DELETE). |
| 36 | + - |
| 37 | + - **SOAP (Simple Object Access Protocol)**: A more rigid protocol compared to REST, typically used for enterprise-level applications that require strict message formats. |
| 38 | + - |
| 39 | + - **GraphQL**: A query language for APIs, designed to allow clients to request only the data they need. |
| 40 | + - |
| 41 | + - **gRPC (Google Remote Procedure Call)**: A framework for building high-performance APIs, which uses HTTP/2 and Protocol Buffers for faster communication. |
| 42 | + - |
| 43 | + - ## Important Notes: |
| 44 | + - **Authentication**: Always use secure authentication methods such as OAuth or API keys and store them securely. |
| 45 | + - **Error Handling**: Ensure to handle errors (e.g., 404 Not Found, 500 Internal Server Error) gracefully to avoid system crashes. |
| 46 | + - **Throttling**: Many APIs implement rate limiting or throttling to prevent excessive load on their servers. Be mindful of these limits during development. |
| 47 | + - **Data Privacy**: Be aware of the privacy policies and data security regulations (e.g., GDPR) when handling sensitive data through APIs. |
| 48 | + - |
| 49 | + - **Data Sharing**: |
| 50 | + - Many APIs return data in **JSON** or **XML** format, so it’s essential to parse and process the data correctly. |
| 51 | + - Ensure any data shared via APIs is sanitized and validated to prevent security vulnerabilities like injection attacks. |
| 52 | + - |
| 53 | + - **Common API Status Codes**: |
| 54 | + - **200 OK**: The request was successful. |
| 55 | + - **201 Created**: A new resource has been created successfully. |
| 56 | + - **400 Bad Request**: The request could not be understood due to invalid syntax. |
| 57 | + - **401 Unauthorized**: The request lacks valid authentication credentials. |
| 58 | + - **500 Internal Server Error**: A generic error indicating a problem on the server side. |
| 59 | +- |
| 60 | +- # Libs & Framework |
| 61 | + - **Axios (JavaScript)**: A promise-based HTTP client for the browser and Node.js, widely used for interacting with REST APIs. |
| 62 | + - Link: [Axios Docs](https://axios-http.com/docs/intro) |
| 63 | + - **Requests (Python)**: A simple, elegant HTTP library for Python. Ideal for making API requests. |
| 64 | + - Link: [Request Docs](https://requests.readthedocs.io/en/latest/) |
| 65 | + - **Flask (Python)**: A lightweight web framework to build simple APIs in Python. |
| 66 | + - Link: [Flast Docs](https://flask.palletsprojects.com/en/stable/) |
| 67 | + - **Express (Node.js)**: A minimal and flexible Node.js web application framework that provides robust APIs. |
| 68 | + - Link: [Express Documentation](https://expressjs.com/) |
| 69 | + - **Spring Boot (Java)**: A Java-based framework for building production-ready REST APIs. |
| 70 | + - Link: [Spring Boot Documentation](https://spring.io/projects/spring-boot) |
| 71 | + - **FastAPI (Python)**: A modern, fast framework for building APIs with Python 3.6+. |
| 72 | + - Link: [FastApi Docs](https://fastapi.tiangolo.com/) |
0 commit comments