I find that it helps myself to come up with a simple, toy example of the problem I'm trying to solve. That often at least helps clear any misconceptions. Let me try to do that for your example:
You have a databin with some data and each entry is labeled with a specific site ID:
myBin = CreateDatabin[
"Interpretation" -> <|"SiteID" -> "String", "Reading" -> "String"|>];
DatabinAdd[myBin, <|"SiteID" -> "a", "Reading" -> "11"|>];
DatabinAdd[myBin, <|"SiteID" -> "b", "Reading" -> "24"|>];
DatabinAdd[myBin, <|"SiteID" -> "a", "Reading" -> "36"|>];
DatabinAdd[myBin, <|"SiteID" -> "b", "Reading" -> "41"|>];
We might want to extract data from a specific SiteID. We can write a function to do this:
getSiteFromBin[bin_, site_] :=
Map[Lookup["Reading"]]@
Select[Lookup[#, "SiteID"] == site &]@Normal[bin]
There are different ways of writing this function. But you can test that it works:
getSiteFromBin[myBin, "a"]
{"11", "36"}
We can now build an API that runs this function on our databin:
CloudDeploy[
APIFunction[{"SiteID" -> "String"},
getSiteFromBin[myBin, #SiteID] &], "myAPI"]
CloudObject["https://www.wolframcloud.com/objects/me/myAPI"]
And it works:
URLExecute["https://www.wolframcloud.com/objects/me/myAPI?SiteID=a"]
Is this the kind of thing you're trying to do?