{"__v":5,"_id":"564f14d829338a1700beefcd","category":{"__v":6,"_id":"568585153703ed1700e420b0","pages":["568585ded96a760d00545da2","5685860f009a8d0d0079711c","5685865554f9a50d00f982dc","56858741d96a760d00545da4","5685a6e00ffbaf17007c6859","56ee9edbb76bc319004627ee"],"project":"564621e00c30fb2100ba3814","version":"564621e10c30fb2100ba3817","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-12-31T19:42:13.206Z","from_sync":false,"order":1,"slug":"mobfox-supply-side-platform","title":"Publisher Resources"},"parentDoc":null,"project":"564621e00c30fb2100ba3814","user":"56499dade2efd717002afc83","version":{"__v":14,"_id":"564621e10c30fb2100ba3817","project":"564621e00c30fb2100ba3814","createdAt":"2015-11-13T17:46:09.275Z","releaseDate":"2015-11-13T17:46:09.275Z","categories":["564621e10c30fb2100ba3818","564624cf0c30fb2100ba3822","564628d69f3f550d00fa3db6","564dafeeda00e82b00ed601d","564daff8fc36dc3700882b95","564db0ccda00e82b00ed601f","564dcf87d3320b0d0028ca10","5661a6e436398e0d00f79566","568585153703ed1700e420b0","56858767d96a760d00545da6","56858d693703ed1700e420b2","56858d8d22c41b0d00e4666c","56859e9c009a8d0d00797130","5685a6453703ed1700e420d3"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-20T12:40:56.445Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"The IP is then used for location/netspeed detection (via [MaxMind](https://www.maxmind.com)) and subsequently for fraud checking on impressions/clicks. This applies to all our ad endpoints (banner, video, native).\n\nFirst the code looks at the **&rt=** parameter of the ad request. When **rt** is one of:\n  * javascript\n  * json\n  * iphone_app\n  * android_app\n  * wp7_app\n  * ios_app\n  * ipad_app\n  * api-fetchip\n\nthe **fetch** method will be used.\n\nWhen **rt** is one of:\n  * xml\n  * api\n  * or any other value\n  * or missing\n\nthe **request** method will be used.\n\nThe **fetch** method looks at the **&h[X-Forwarded-For]** request parameter, then the **HTTP_X_FORWARDED_FOR** header, then the **REMOTE_ADDR** setting (the source IP of the HTTP request itself) in this sequence. The first one present and valid will be picked.\n\nThe **request** method looks at the **&i=** request parameter and picks it if valid.\n\n[For more information on our Ad Request API parameters click here](doc:ad-request-api).\n\nValid IP addresses are those which are not in private nor reserved ranges.\nhttps://en.wikipedia.org/wiki/Private_network#Private_IPv4_address_spaces https://en.wikipedia.org/wiki/Reserved_IP_addresses#IPv4","excerpt":"","slug":"obtaining-ip-address","type":"basic","title":"Obtaining IP Address"}

Obtaining IP Address


The IP is then used for location/netspeed detection (via [MaxMind](https://www.maxmind.com)) and subsequently for fraud checking on impressions/clicks. This applies to all our ad endpoints (banner, video, native). First the code looks at the **&rt=** parameter of the ad request. When **rt** is one of: * javascript * json * iphone_app * android_app * wp7_app * ios_app * ipad_app * api-fetchip the **fetch** method will be used. When **rt** is one of: * xml * api * or any other value * or missing the **request** method will be used. The **fetch** method looks at the **&h[X-Forwarded-For]** request parameter, then the **HTTP_X_FORWARDED_FOR** header, then the **REMOTE_ADDR** setting (the source IP of the HTTP request itself) in this sequence. The first one present and valid will be picked. The **request** method looks at the **&i=** request parameter and picks it if valid. [For more information on our Ad Request API parameters click here](doc:ad-request-api). Valid IP addresses are those which are not in private nor reserved ranges. https://en.wikipedia.org/wiki/Private_network#Private_IPv4_address_spaces https://en.wikipedia.org/wiki/Reserved_IP_addresses#IPv4