Skip to main content

A Python client for BigDataCloud API connectivity (https://www.bigdatacloud.net)

Project description

BigDataCloud Python API Client

A Python client for connecting to the API services provided by BigDataCloud

What API services does BigDataCloud offer?

BigDataCloud offers a range of extremely useful and fast APIs that can be utilised in both backend and frontend scenarios. From validating customer input live to the next generation of IP Geolocation technology, BigDataCloud has an API suitable to your needs.

For a full list of APIs, visit our documentation area.

You can access any and all BigDataCloud APIs with a free API Key. To get your API Key, just access your account and retrieve it from your Account Dashboard. If you are not yet a customer, it is completely free to join.

Documentation

For documentation specific to this api client, please read below. For more specific documentation to the APIs available, including endpoints, request and response data, please visit our documentation area.

Authentication / Identification

To use this API client you must have a BigDataCloud API Key. To get your personal key, just access your account and retrieve it from your Account Dashboard. If you are not yet a customer, it is completely free to join.

Simply provide this key when initiating the api client, and it will be included in all requests to the BigDataCloud API Server. See the example below.

Python 2.x Installation

pip install bigdatacloudapi-client

Python 3.x Installation

pip3 install bigdatacloudapi-client

Example usage

import bigdatacloudapi

apiKey = 'XXX' # XXX being your api key found at: https://www.bigdatacloud.net/customer/account

client = bigdatacloudapi.Client(apiKey)

resultObject,httpResponseCode = client.getIpGeolocationFull({"ip":"8.8.8.8"})

print('HTTP Response Code: ',httpResponseCode)
print('Lookup IP: ',resultObject['ip'])
print('Result: ',resultObject)

Example output

{
    "ip": "8.8.8.8",
    "country": {
        "isoAlpha2": "US",
        "isoAlpha3": "USA",
        "m49Code": 840,
        "isoName": "United States of America (the)",
        "isoAdminLanguages": [
            {
                "isoAlpha3": "eng",
                "isoAlpha2": "en",
                "isoName": "English"
            }
        ],
        "unRegion": "Americas/Northern America",
        "currency": {
            "numericCode": 840,
            "code": "USD",
            "name": "US Dollar",
            "minorUnits": 2
        },
        "wbRegion": {
            "id": "NAC",
            "iso2Code": "XU",
            "value": "North America"
        },
        "wbIncomeLevel": {
            "id": "HIC",
            "iso2Code": "XD",
            "value": "High income"
        },
        "callingCode": "1",
        "countryFlagEmoji": "🇺🇸"
    },
    "location": {
        "isoPrincipalSubdivision": "California",
        "isoPrincipalSubdivisionCode": "US-CA",
        "city": "Mountain View",
        "postcode": "94043",
        "latitude": 37.42,
        "longitude": -122.09,
        "timeZone": {
            "ianaTimeId": "America/Los_Angeles",
            "displayName": "(UTC-08:00) Pacific Time (US & Canada)",
            "effectiveTimeZoneFull": "Pacific Daylight Time",
            "effectiveTimeZoneShort": "PDT",
            "UtcOffsetSeconds": -25200,
            "UtcOffset": "-07",
            "isDaylightSavingTime": true,
            "localTime": "2019-04-06T04:06:39.1691744"
        }
    },
    "lastUpdated": "2019-04-06T09:09:36.1877959Z",
    "network": {
        "registry": "ARIN",
        "registryStatus": "assigned",
        "registeredCountry": "US",
        "registeredCountryName": "United States of America (the)",
        "organisation": "Google LLC",
        "isReachableGlobally": true,
        "isBogon": false,
        "bgpPrefix": "8.8.8.0/24",
        "bgpPrefixNetworkAddress": "8.8.8.0",
        "bgpPrefixLastAddress": "8.8.8.255",
        "totalAddresses": 256,
        "carriers": [
            {
                "asn": "AS15169",
                "asnNumeric": 15169,
                "organisation": "Google LLC",
                "name": "GOOGLE",
                "registry": "ARIN",
                "registeredCountry": "US",
                "registeredCountryName": "United States of America (the)",
                "registrationDate": "2000-03-30",
                "registrationLastChange": "2012-02-25",
                "totalIpv4Addresses": 8698103,
                "totalIpv4Prefixes": 435,
                "totalIpv4BogonPrefixes": 0,
                "rank": 53,
                "rankText": "#53 out of 62,872"
            }
        ],
        "viaCarriers": [
            {
                "asn": "AS7018",
                "asnNumeric": 7018,
                "organisation": "ATT Services Inc.",
                "registeredCountry": "US",
                "registeredCountryName": "United States of America (the)",
                "rank": 2
            },
            /*........*/
            {
                "asn": "AS31019",
                "asnNumeric": 31019,
                "organisation": "Paulus M. Hoogsteder trading as Meanie",
                "registeredCountry": "NL",
                "registeredCountryName": "Netherlands (the)",
                "rank": 51153
            }
        ]
    },
    "confidence": "low",
    "confidenceArea": [
        {
            "latitude": 18.0256672,
            "longitude": -66.5275345
        },
        /*........*/
        {
            "latitude": 18.0256672,
            "longitude": -66.5275345
        }
    ],
    "securityThreat": "unknown",
    "hazardReport": {
        "isKnownAsTorServer": false,
        "isKnownAsProxy": false,
        "isKnownAsMailServer": false,
        "isKnownAsPublicRouter": false,
        "isBogon": false,
        "isUnreachable": false
    }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bigdatacloudapi-client-1.0.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

bigdatacloudapi_client-1.0.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file bigdatacloudapi-client-1.0.1.tar.gz.

File metadata

  • Download URL: bigdatacloudapi-client-1.0.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for bigdatacloudapi-client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3c2189f7f658a942f7338c58f2709f117f24522c2f493125820723294af48bbd
MD5 952bb530276cf2e344e7e7541b054cc2
BLAKE2b-256 701dde9612756b9e1572c6c697b8f7a2f79975df9d2eea0417d3e4192711418d

See more details on using hashes here.

File details

Details for the file bigdatacloudapi_client-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: bigdatacloudapi_client-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for bigdatacloudapi_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d45a26c5c6e6e867274a74e5317738533571b391a394dece82fd91cdcf5d9754
MD5 7114672e5e6fc20ad40cc1bd8a1dbcf1
BLAKE2b-256 311f58b2cb63eb87c079ec5c5e58dff3ae29dadd1636818c40ab811c2acddfea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page