All About Api
All About Api
API ka matlab hota hai ek set of rules aur protocols jo do software applications ko ek doosre se baat karne dete hain.
Example: Jab tu Zomato pe order karta hai, toh Zomato ka app Google Maps ke API ko use karke restaurant ki location show karta hai.
2. API Call
Jab hum API se kuch request bhejte hain (jaise login karte waqt username aur password enter karte hain), usse API Call kehte hain.
Example: Tu Instagram pe "Login" pe click karta hai, toh backend me ek API call hoti hai jo tere credentials ko server tak bhejti hai.
3. API Economy
Ye term batata hai ki businesses kaise APIs ka use karke paisa kama rahe hain.
Example: Uber ne Google Maps ki API use ki, isse unhone apna kaam asaan kar liya bina nayi maps service develop kiye.
1
@Code_Wraith
4. API Endpoint
Endpoint basically wo URL hota hai jaha API request jaati hai.
Example: Agar tu ek weather app banata hai, toh "https://api.weather.com/current" ek endpoint ho sakta hai jaha se tu current weather data
lega.
5. API Integration
Example: Shopify aur PayPal ko integrate karna taki payment automatic ho jaye.
6. API Gateway
API Gateway ek middleman hota hai jo API requests ko f㘶lter, monitor, aur manage karta hai.
Example: Agar tu Netf㘶ix ka server access kar raha hai, toh pehle teri request API Gateway se hokar jayegi.
7. API Lifecycle
@Code_Wraith
Stages: Creation Management Consumption Retirement
Example: Ek API develop hui, market me aayi, use hui, aur jab outdate ho gayi toh band kar di gayi.
8. API Request
Jab hum API ko data ya action perform karne ke liye request bhejte hain.
Example: Jab tu "GET" request bhejta hai, toh server se data fetch hota hai.
9. API Key
Example: Jab tu koi third-party service use karta hai, toh wo API Key ki madad se authenticate karti hai.
Ek interface hota hai jo back-end services aur front-end applications ko connect karta hai.
Example: Jaise tu Netf㘶ix pe search karta hai, API Layer hi data ko fetch karke display karti hai.
API Portal wo jagah hoti hai jaha developers ko APIs ki saari information milti hai.
1
@Code_Wraith
12. API Security
API Security ka matlab hai API ko hackers, misuse aur attacks se protect karna.
13. Apigee
Apigee ek API Management Tool hai jo Google ka hai. Ye API ko manage, secure aur analytics provide karta hai.
Example: Agar tu multiple APIs handle kar raha hai, toh Apigee un sab ko ek proxy layer me wrap kar ke secure kar dega.
14. APIsec
APIsec ek company hai jo automated tools ka use karke APIs ke security f㘶aws detect karti hai.
Example: Tere ko agar APIs me vulnerabilities check karni ho, toh APIsec tools ka use karke tu code ko production me jaane se pehle test
kar sakta hai.
Application Framework ek predef㘶ned structure hota hai jo developers ko software ya apps banane me madad karta hai.
@Code_Wraith
Example: Agar tu Django (Python) ya Express.js (Node.js) use karta hai, toh wo application frameworks hai jo backend development ko
asaan banate hain.
Burp Suite ek penetration testing tool hai jo web applications me security vulnerabilities dhoondta hai.
Example: Tu isse API requests ko intercept karke dekh sakta hai ki headers, parameters, aur responses me koi f㘶aw toh nahi.
CI/CD ek process hai jisse code changes ko automate karke fast aur safe deploy kiya jata hai.
Example: Agar tu GitHub me code push karta hai aur automatically tera server update ho jaye, toh ye CI/CD ka magic hai.
CRUD basic operations hote hain jo databases me perform kiye jate hain.
Example: Jab tu Instagram pe post banata hai (Create), dekhte hai (Read), edit karta hai (Update), ya delete karta hai (Delete) — ye sab
CRUD operations hai.
19. Cache
@Code_Wraith
Cache ek temporary storage hoti hai jo data ko fast access ke liye rakhti hai.
Example: Agar tu ek baar ek webpage kholta hai, toh agle time me wo fast load hota hai kyunki uska data cache me saved hota hai.
20. Client
Client wo device ya software hota hai jo server se data request karta hai.
Example: Tera phone, jab tu WhatsApp kholta hai aur messages fetch karta hai, toh tera phone client hai aur WhatsApp ka server server hai.
DDoS ek attack hota hai jisme ek server pe itni saari requests bheji jati hai ki wo server down ho jaye.
Example: Jaise agar ek website pe 1000 fake users ek saath login kare, toh server overload ho jayega aur real users ko access nahi milega.
22. Resource
Resource wo data ya content hota hai jo API ke through accessible hota hai.
Example: Tere weather app me "Current Temperature" ek resource hai jo API se fetch hota hai.
23. Request
@Code_Wraith
Example: Jab tu "GET /users" request bhejta hai, toh server se sab users ki list milti hai.
24. Response
Example: Agar tu YouTube pe search kare "Latest Songs," toh server response me songs ki list bhejega.
Response Code ek numerical code hota hai jo request ki success ya failure ko batata hai.
Common Codes: 200 (OK), 404 (Not Found), 500 (Server Error)
Example: Agar tu galat URL hit kare, toh tujhe "404 Not Found" error dikhega.
@Code_Wraith
1
26. Payload
Payload wo data hota hai jo API request ya response ke through bheja jata hai.
Example: Agar tu "POST" request ke through registration form submit karta hai, toh user data (name, email, password) payload ke form me
server ko bheja jata hai.
27. Pagination
Jab data bohot zyada hota hai toh usse chhote-chhote pages me divide karna Pagination kehlata hai.
Example: Jab tu Amazon pe products dekh raha hota hai aur "Next Page" pe click karta hai, toh wo API call pagination ka use karke sirf
specif㘶c page ka data laati hai.
1
@Code_Wraith
28. Method
Methods APIs me batate hain ki request ka purpose kya hai. Common methods:
Query Parameters wo f㘶lters hote hain jo API request ke URL me add kiye jate hain, taki specif㘶c data mile.
Example: Agar tu "GET /products?category=mobile&price<5000" bhejta hai, toh tujhe sirf wo mobiles milenge jinke price 5000 se kam hai.
30. Authentication
Example: Jab tu Netf㘶ix pe login karta hai, toh API user credentials check karke access deti hai.
Rate Limiting APIs me requests ki maximum limit set karta hai taki misuse na ho.
@Code_Wraith
Example: Agar tu kisi API ko 100 requests per minute ki limit ke saath use kar raha hai, aur tu 101 requests bhejega toh tujhe "429 Too Many
Requests" error milega.
API Documentation wo manual hoti hai jisme API ka poora use, endpoints, parameters, aur examples diye hote hain.
Example: Postman ya Swagger jaha se tu API ko test kar sakta hai aur uske usage ko samajh sakta hai.
Logic Flaw ek vulnerability hoti hai jab application unexpected behavior show karti hai.
Example: Agar login page me tu valid credentials ke bina bhi access le sake, toh ye logic f㘶aw hai.
JSON ek data format hai jo APIs me data exchange ke liye use hota hai. Ye human-readable aur machine-readable dono hota hai.
Example: { "name": "Wraith", "role": "Hacker" } — JSON me data key-value pairs me hota hai.
35. Microservices
@Code_Wraith
Microservices architecture me ek application ko chhote-chhote independent services me tod diya jata hai.
Example: Amazon ki site me cart, payment, search — sab apne alag-alag microservices hote hain.
36. Monetization
Example: PayPal ki API use karne ke liye wo developers se fees charge karte hain.
OWASP ek organization hai jo web application security ke best practices aur tools provide karta hai.
Example: OWASP Top 10 list me web applications ki common vulnerabilities jaise SQL Injection, XSS, etc. cover hoti hain.
Over-Permissioned Container wo container hota hai jise server ke zyada permissions mil jati hain jo risky ho sakti hai.
Example: Agar koi Docker container ko unnecessary root access mil jaye toh attacker poore server ko compromise kar sakta hai.
39. Parameters
@Code_Wraith
Parameters wo variables hote hain jo functions ya APIs ko input provide karte hain.
Example: Agar tu API request me "userId=123" bhejta hai, toh "userId" parameter ho gaya.
Pen Testing ek process hai jisse systems aur applications me security vulnerabilities ko dhoondha jata hai.
Example: Burp Suite ya ZAP tools se API ko test karke security loopholes f㘶nd karna.
Production Environment wo environment hota hai jaha application real users ke liye live hoti hai.
Example: Jab tera website localhost se server pe deploy ho jaye aur real users use karne lage, wo production environment hai.
REST ek architectural style hai APIs ke liye jisme client aur server stateless hote hain.
Example: Agar tu RESTful API se "GET /users" call karta hai, toh server bas data bhejega bina kisi session ko store kiye.
@Code_Wraith
Red Team cybersecurity professionals ki team hoti hai jo organization ke systems ko hack karke unke security f㘶aws detect karti hai.
Example: Ek company apni security ko test karne ke liye red team hire karti hai jo ek real-world attack simulate karti hai.
SDK developers ko tools, code snippets aur documentation provide karta hai kisi specif㘶c platform ke liye apps banane me.
Example: Agar tu Android apps banata hai, toh Android SDK tere ko sab tools aur libraries provide karega.
SDLC ek process hai jisme software development ke har phase ko systematically cover kiya jata hai.
SOAP ek protocol hai APIs ke liye jo XML format use karta hai aur zyada secure aur structured hota hai.
Example: Bank aur f㘶nancial services me SOAP APIs use hoti hain kyunki wo data security pe zyada focus karti hain.
@Code_Wraith
SQL Injection ek attack hai jisme attacker application ke SQL queries me malicious code inject karta hai.
Example: Agar login form me ' OR '1'='1' likhne se login ho jaye, toh wo SQL Injection hai.
48. Webhook
Webhook ek event-driven API hoti hai jo data ko automatically push karti hai jab specif㘶c event trigger hota hai.
Example: Jab tu GitHub pe code push karta hai aur tera Telegram bot auto-update ka message bhejta hai, wo webhook se possible hota hai.
ZAP OWASP ka ek free security tool hai jo automatic vulnerability scanning aur penetration testing ke liye use hota hai.
Example: Isse tu apni APIs ko security loopholes ke liye scan kar sakta hai.
Yeh lo bhai, poori API terminology ka knowledge ekdum easy aur real-time examples ke saath! Ab bata, aur kuch specif㘶c chahiye ya isme se koi
topic aur detail me samajhna hai?
@Code_Wraith
50. THIRD PARTY API
Example :- Maan lo tumhe Random User Data API ka response chahiye, jo ekdum free hai aur use karna bhi
easy hai.
* API Ka Example:
# code
# API Endpoint
url = "https://randomuser.me/api/"
# API Call
response = requests.get(url)
@Code_Wraith
51. DIFFRENCE BETWEEN OWN API OR THIRD PARTY API
Mtlb Tum apne server par ek API create karte ho jo specific data ya functionality provide kare.
Tum decide karte ho ki endpoints, methods, aur data format kaisa hoga.
Use Case:
Agar tumhe apni website ya app ke liye custom functionality chahiye, jaise:
Ek blog site me articles fetch karna (GET /articles).
Ek e-commerce site me order create karna (POST /orders).
Example:
Agar tum Python Flask use karte ho apni API banane ke liye:
# code
app = Flask(__name__)
# API Endpoint
@app.route('/greet', methods=['GET'])
def greet_user():
name = request.args.get('name', 'Guest')
return jsonify({'message': f'Hello, {name}!'})
if __name__ == '__main__':
app.run(port=5000)
URL: http://localhost:5000/greet?name=Wraith
Response: {"message": "Hello, Wraith!"}
@Code_Wraith
2. Dusri Site ki API Use Karna (Using Third-Party API):
Mtlb Tum already existing API ko use karte ho apni application me.
Tumhe sirf API ka endpoint aur documentation chahiye hota hai.
Use Case:
Agar tumhe Google Maps, Payment Gateway (Stripe, PayPal), ya Weather API ka data chahiye.
Tum apni site pe login with Google/Facebook jaise features add kar rahe ho.
# code
import requests
print(response.json())
@Code_Wraith
@Code_Wraith
I am @Code_Wraith, a cybersecurity expert with a passion for teaching and sharing knowledge.
Join our Telegram channel 'Dark Froxt' for the latest in cybersecurity, cracking, and ethical hacking.
Stay ahead in the world of technology and enhance your skills with our expert guidance!
CHANNEL :- https://t.me/+1sHHe24EHDFmMGU1
CONTACT :- @Code_Wraith
Mail :- [email protected]
@Code_Wraith