Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about the response JSON structure and API service #6

Closed
hossain-khan opened this issue Jun 9, 2020 · 3 comments
Closed

Question about the response JSON structure and API service #6

hossain-khan opened this issue Jun 9, 2020 · 3 comments

Comments

@hossain-khan
Copy link

hossain-khan commented Jun 9, 2020

Hey @949mac kudos for putting time to make this API possible. I am working on a front end client Android app using same data source.

{
  "id":"7b05ac80-a9d6-11ea-a72a-db8cd82c4def",
  "pb_id":"ut-saltlakecity-4",
  "state":"Utah",
  "city":"Salt Lake City",
  "date":"2020-05-30T00:00:00.000000Z",
  "title":"Police shoot tear gas canister at man from close range, striking him in the chest",
  "description":null,
  "links":[
    "https:\/\/twitter.com\/greg_doucette\/status\/1268333029526843392",
    "https:\/\/www.instagram.com\/p\/CA148-0B14t6mQZqJZYzwq25KdoPzZ5CJmV3oQ0\/"
  ],
  "data":null,
  "geocoding":{
    "lat":"40.7607793",
    "long":"-111.8910474"
  }
}

I'm deciding between using plain raw data and the API exposed by api.846policebrutality.com

I see some differences between the all-locations.json data and API response, I just wanted to confirm few things.

  1. The "id":"7b05ac80-a9d6-11ea-a72a-db8cd82c4def" is likely system auto-generated. Is it going to be stay consistent after each data import? or it will generate new set of keys?
  2. I see you have thought of future and added "description":null - I am guessing this will stay as null until there is way to manually update them for each item.
  3. What is the purpose of "data":null field?
  4. Where is "geocoding": {} data coming from? it's not in the original source.

Also, wondering where is the api.846policebrutality.com hosted and how long will it stay live? I am sure there is cost associated with it.

@MikeCraig418
Copy link
Owner

Hello, thanks for coming by!

I'm deciding between using plain raw data and the API exposed by api.846policebrutality.com
This API should allow you to deliver a better experience to the end user. You should be able to pull only the information you need. For mobile, this can play a huge role.

For example, if you want to perform back-end filter by state, or date, you can do this easily. For example, this request is only 15kb:
image

id":"7b05ac80-a9d6-11ea-a72a-db8cd82c4def" is likely system auto-generated. Is it going to be stay consistent after each data import? or it will generate new set of keys?

My ID might change, but its not to likely. They have been pretty stable for the past few days.

I see you have thought of future and added "description":null - I am guessing this will stay as null until there is way to manually update them for each item.

That is correct. You can ignore this field for now. Check this issue 2020PB/police-brutality#504 for changes to API structure.

What is the purpose of "data":null field?

Originally I was expected to pull in some additional information from the main feed. You can ignore this field, and it will probably be dropped sometime.

Where is "geocoding": {} data coming from? it's not in the original source.

I fetch it from Google. Check it out: https://github.com/949mac/846-backend/blob/develop/app/Console/Commands/UpdateLatLong.php

Also, wondering where is the api.846policebrutality.com hosted and how long will it stay live? I am sure there is cost associated with it.

I will keep this service online indefinitely. If it becomes cost prohibitive to stay online, I'll give you and everyone else plenty of notice. But right now, there is no plan to retire the endpoint at any time!

@hossain-khan
Copy link
Author

Thanks a lot for taking the time and answering them, this helps a lot 🙏

@hossain-khan
Copy link
Author

Hey Mike, just FYI I have finished integrating with the API. It's working very nicely. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants