From 962e4fe6b356b59185c9b527271c4ad70ebcfe7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 21 May 2019 11:07:01 +0200 Subject: [PATCH 1/3] Add CURL example --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 5370f69..adc23a6 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,12 @@ BGP Ranking service is available online [http://bgpranking.circl.lu/](http://bgp A Python library and client software is [available](https://github.com/D4-project/BGP-Ranking/tree/master/client) using the default API available from bgpranking.circl.lu. +# CURL Example + +```bash +curl -X POST -d '{"asn": "5577"}' https://bgpranking-ng.circl.lu/json/asn +``` + # Server Installation (if you want to run your own) **IMPORTANT**: Use [pipenv](https://pipenv.readthedocs.io/en/latest/) From aaab8fb5b2607c3a5818ca4a6f7db7f93cf30da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 21 May 2019 11:22:58 +0200 Subject: [PATCH 2/3] Update README.md --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/README.md b/README.md index adc23a6..a885dac 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,52 @@ A Python library and client software is [available](https://github.com/D4-projec # CURL Example +## Get the ASN from an IP or a prefix ```bash +curl https://bgpranking-ng.circl.lu/ipasn_history/?ip=143.255.153.0/24 +``` + +## Response + +```json +{ + "meta": { + "address_family": "v4", + "ip": "143.255.153.0/24", + "source": "caida" + }, + "response": { + "2019-05-19T12:00:00": { + "asn": "264643", + "prefix": "143.255.153.0/24" + } + } +} +``` + +## Get the ranking of the AS +``` curl -X POST -d '{"asn": "5577"}' https://bgpranking-ng.circl.lu/json/asn ``` +## Response + +```json +{ + "meta": { + "asn": "5577" + }, + "response": { + "asn_description": "ROOT, LU", + "ranking": { + "rank": 0.0004720052083333333, + "position": 7084, + "total_known_asns": 15375 + } + } +} +``` + # Server Installation (if you want to run your own) **IMPORTANT**: Use [pipenv](https://pipenv.readthedocs.io/en/latest/) From 57c6e855f61aaedfbeabe901239a1d8c1dd7e14a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 21 May 2019 12:06:53 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a885dac..76459b9 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,11 @@ curl https://bgpranking-ng.circl.lu/ipasn_history/?ip=143.255.153.0/24 ## Get the ranking of the AS ``` -curl -X POST -d '{"asn": "5577"}' https://bgpranking-ng.circl.lu/json/asn +curl -X POST -d '{"asn": "5577", "date": "2019-05-19"}' https://bgpranking-ng.circl.lu/json/asn ``` +Note: `date` isn't required. + ## Response ```json