You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -351,6 +351,69 @@ MIDDLEWARE = [
351
351
352
352
We also provide an async Lite API middleware to be used under ASGI. Use `'ipinfo_django.middleware.IPinfoAsyncLiteMiddleware` in that case.
353
353
354
+
### Core API
355
+
356
+
The library also supports the [Core API](https://ipinfo.io/developers/data-types#core-data), which provides city-level geolocation with nested geo and AS objects. Authentication with your token is required.
357
+
358
+
To use it add `'ipinfo_django.middleware.IPinfoCoreMiddleware'` to `settings.MIDDLEWARE` in `settings.py`:
We also provide an async Core API middleware to be used under ASGI. Use `'ipinfo_django.middleware.IPinfoAsyncCoreMiddleware` in that case.
370
+
371
+
### Plus API
372
+
373
+
The library also supports the [Plus API](https://ipinfo.io/developers/data-types#plus-data), which provides enhanced data including mobile carrier info and privacy detection. Authentication with your token is required.
374
+
375
+
To use it add `'ipinfo_django.middleware.IPinfoPlusMiddleware'` to `settings.MIDDLEWARE` in `settings.py`:
We also provide an async Plus API middleware to be used under ASGI. Use `'ipinfo_django.middleware.IPinfoAsyncPlusMiddleware` in that case.
387
+
388
+
### Residential Proxy API
389
+
390
+
The library also supports the [Residential Proxy API](https://ipinfo.io/developers/residential-proxy-api), which allows you to check if an IP address is a residential proxy. Authentication with your token is required.
391
+
392
+
To use it add `'ipinfo_django.middleware.IPinfoResproxyMiddleware'` to `settings.MIDDLEWARE` in `settings.py`:
The residential proxy details will be available through `request.ipinfo_resproxy`:
404
+
405
+
```python
406
+
defmy_view(request):
407
+
resproxy = request.ipinfo_resproxy
408
+
if resproxy:
409
+
print(resproxy.ip) # 175.107.211.204
410
+
print(resproxy.last_seen) # 2025-01-20
411
+
print(resproxy.percent_days_seen) # 0.85
412
+
print(resproxy.service) # Bright Data
413
+
```
414
+
415
+
We also provide an async Residential Proxy API middleware to be used under ASGI. Use `'ipinfo_django.middleware.IPinfoAsyncResproxyMiddleware` in that case.
416
+
354
417
### Local development and testing
355
418
356
419
To test the project locally, install Tox in your Python virtual environment:
0 commit comments