DEV Community

Cover image for Difference Between REST API and Normal API
aryan015
aryan015

Posted on

2

Difference Between REST API and Normal API

๐Ÿš€ 1. ๐Ÿ”ฅ What is a Normal API?

  • API (Application Programming Interface) is a generic term for any set of functions or methods that allow applications to communicate with each other.
  • It can be:
    • Local or remote.
    • Can use any protocol (HTTP, TCP, UDP, etc.).
  • Not restricted to web-based communication.
  • Examples:
    • Library API: Pythonโ€™s math.sqrt() function.
    • Database API: MySQL Connector for interacting with a database.
    • System API: Linux system calls like read() or write().
    • Hardware API: DirectX for rendering graphics.

๐Ÿ”ฅ 2. โš™๏ธ What is a REST API?

  • REST (Representational State Transfer) is a specific type of web API.
  • It follows the RESTful architecture and uses HTTP methods to interact with resources.
  • REST APIs:
    • Use stateless communication (each request is independent).
    • Use standard HTTP methods:
      • GET โ†’ Retrieve data.
      • POST โ†’ Create new data.
      • PUT/PATCH โ†’ Update existing data.
      • DELETE โ†’ Remove data.
    • Use JSON or XML for data exchange.
  • Examples:
    • GitHub REST API: To access GitHub data over HTTP.
    • OpenWeather API: For weather data retrieval.
    • Stripe API: For payment processing.

โš™๏ธ 3. Key Differences:

Feature Normal API REST API
Scope Generic term for all APIs Specific type of web API
Protocol Uses any protocol (TCP, UDP, etc.) Uses HTTP/HTTPS only
State management Can be stateful or stateless Stateless by design
Data format Any format (binary, JSON, XML) Mostly JSON or XML
Methods Varies (no fixed methods) Uses standard HTTP methods
Communication Local or remote Web-based (remote) communication
Example File System API, Database API GitHub, Stripe, AWS S3 REST API

โœ… ๐Ÿ”ฅ Final Takeaway:

  • Normal API: A broad term covering all APIs (local, web, database, etc.).
  • REST API: A specific type of web API that uses HTTP and follows RESTful principles.
  • All REST APIs are APIs, but not all APIs are RESTful. ๐Ÿš€

ACI image

ACI.dev: Best Open-Source Composio Alternative (AI Agent Tooling)

100% open-source tool-use platform (backend, dev portal, integration library, SDK/MCP) that connects your AI agents to 600+ tools with multi-tenant auth, granular permissions, and access through direct function calling or a unified MCP server.

Star our GitHub!

Top comments (0)

Tiger Data image

๐Ÿฏ ๐Ÿš€ Timescale is now TigerData: Building the Modern PostgreSQL for the Analytical and Agentic Era

Weโ€™ve quietly evolved from a time-series database into the modern PostgreSQL for todayโ€™s and tomorrowโ€™s computing, built for performance, scale, and the agentic future.

So weโ€™re changing our name: from Timescale to TigerData. Not to change who we are, but to reflect who weโ€™ve become. TigerData is bold, fast, and built to power the next era of software.

Read more

๐Ÿ‘‹ Kindness is contagious

Explore this insightful write-up embraced by the inclusive DEV Community. Tech enthusiasts of all skill levels can contribute insights and expand our shared knowledge.

Spreading a simple "thank you" uplifts creatorsโ€”let them know your thoughts in the discussion below!

At DEV, collaborative learning fuels growth and forges stronger connections. If this piece resonated with you, a brief note of thanks goes a long way.

Okay