Skip to content

Commit 56f6b18

Browse files
authored
Merge pull request #42 from ipinfo/silvano/eng-615-update-readme-documentation-for-ipinfodjango
Add documentation for Core and Plus bundles and resproxy
2 parents 98bee74 + 6fca4bb commit 56f6b18

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,69 @@ MIDDLEWARE = [
351351

352352
We also provide an async Lite API middleware to be used under ASGI. Use `'ipinfo_django.middleware.IPinfoAsyncLiteMiddleware` in that case.
353353

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`:
359+
360+
```python
361+
MIDDLEWARE = [
362+
'django.middleware.security.SecurityMiddleware',
363+
'django.contrib.sessions.middleware.SessionMiddleware',
364+
...
365+
'ipinfo_django.middleware.IPinfoCoreMiddleware',
366+
]
367+
```
368+
369+
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`:
376+
377+
```python
378+
MIDDLEWARE = [
379+
'django.middleware.security.SecurityMiddleware',
380+
'django.contrib.sessions.middleware.SessionMiddleware',
381+
...
382+
'ipinfo_django.middleware.IPinfoPlusMiddleware',
383+
]
384+
```
385+
386+
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`:
393+
394+
```python
395+
MIDDLEWARE = [
396+
'django.middleware.security.SecurityMiddleware',
397+
'django.contrib.sessions.middleware.SessionMiddleware',
398+
...
399+
'ipinfo_django.middleware.IPinfoResproxyMiddleware',
400+
]
401+
```
402+
403+
The residential proxy details will be available through `request.ipinfo_resproxy`:
404+
405+
```python
406+
def my_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+
354417
### Local development and testing
355418

356419
To test the project locally, install Tox in your Python virtual environment:

0 commit comments

Comments
 (0)