Public APIs

DailyCred provides a several API calls for public use. These are helpful when developing client-side applications in JavaScript.

If you have a CName set up with DailyCred, point these calls to your sub domain instead.

All Info

GEThttps://www.dailycred.com/api/info.json
Example Response:
{
  "client": {
    "os": {
      "family": "Mac OS X",
      "major": "10",
      "minor": "8",
      "patch": "2"
    },
    "userAgent": {
      "family": "Chrome",
      "major": "27",
      "minor": "0",
      "patch": "1453"
    },
    "device": {}
  },
  "local": {
    "city": "Seattle",
    "region": "WA",
    "countryName": "United States",
    "metro_code": 819,
    "area_code": 206,
    "countryCode": "US",
    "dma_code": 819,
    "longitude": -122.3321,
    "latitude": 47.6062
  },
  "lang": {
    "en_us": 0.6,
    "de": 0.2,
    "de_de": 0.4,
    "en_ca": 1,
    "en": 0.8
  },
  "ip": {
    "ip": "98.232.25.85"
  },
  "about": {
    "description": "...",
    "url": "https://www.dailycred.com/docs/public"
  }
}

IP Address

GEThttps://www.dailycred.com/api/ip.json
Example Response:
{
    "ip": "98.232.25.85"
}

Location Parsing

GEThttps://www.dailycred.com/api/local.json
Example Response:
{
  "city": "Seattle",
  "countryName": "United States",
  "dma_code": 819,
  "region": "WA",
  "metro_code": 819,
  "area_code": 206,
  "countryCode": "US",
  "longitude": -122.3321,
  "latitude": 47.6062
}

User-Agent Parsing

GEThttps://www.dailycred.com/api/client.json
Example Response:
{
  "os": {
    "family": "Mac OS X",
    "major": "10",
    "minor": "8",
    "patch": "2"
  },
  "userAgent": {
    "family": "Chrome",
    "major": "27",
    "minor": "0",
    "patch": "1453"
  },
  "device": {}
}

Language Header

GEThttps://www.dailycred.com/api/lang.json
Example Response:
{
  "en_us": 0.6,
  "de": 0.2,
  "de_de": 0.4,
  "en_ca": 1,
  "en": 0.8
}

Optional Parameters

You can provide any of the following optional parameters, which will override auto-detection of ip address, language, and user-agent headers.

ParameterDescription
ip*The ip address to use to locate.
user_agentThe user-agent header to parse.
accept_languageThe accept-language header to parse.