AFCensusAPIClient 0.0.2

AFCensusAPIClient 0.0.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Mar 2015

Maintained by Unclaimed.



  • By
  • PJ Gray

An AFHTTPClient subclass for the Census API.

Usage

Go to the above link to get your census API key.

AFCensusAPIClient* censusClient = [[AFCensusAPIClient alloc] initWithAPIKey:@"YOUR CENSUS KEY HERE"];
[censusClient getMetric:kCensusMetric_OwnerOccupiedHousing
                withLat:@"42.343653"
                withLng:@"-71.097701"
                success:^(AFHTTPRequestOperation *operation, id responseObject) {

                    NSLog(@"Lower Value Owner Occupied Housing: %@", responseObject[kCensusMetric_LowerValueForOwnerOccupiedHousing]);
                    NSLog(@"Median Value Owner Occupied Housing: %@", responseObject[kCensusMetric_MedianValueForOwnerOccupiedHousing]);
                    NSLog(@"Upper Value Owner Occupied Housing: %@", responseObject[kCensusMetric_UpperValueForOwnerOccupiedHousing]);

                } failure:nil];

Supported Metrics

Supported metrics using constants is limited right now, but you can always update this repo, or pass in the codes directly. As built-in constants:

  • kCensusMetric_LowerValueForOwnerOccupiedHousing
  • kCensusMetric_MedianValueForOwnerOccupiedHousing
  • kCensusMetric_UpperValueForOwnerOccupiedHousing
  • kCensusMetric_MedianHouseholdIncome

Contact

PJ Gray

License

AFCensusAPIClient is available under the MIT license. See the LICENSE file for more info.