Getting all blog posts linked to the EU

I’ve just upgraded my Obstracts license to include TTP search.

I am finding the search by country useful, but I want a bit more flexibility to search at continent level.

For example, show me all posts related to Europe.

Right now I can see posts for each European country individually (e.g. France, then Belgium, then…), but ideally I want to achieve this in a single search.

Is this possible?

Not completely possible in one query. It requires some middle work ATM. Here’s how I would do it…

1. Find the region (e.g. Europe)

You can do this in CTI Butler for free using region/sub region/intermediate region search.

Each country object has an id like location--62990a11-0e30-5c51-bc46-b0ce54170f9e

Get all of these ID’s.

If you have a paid subscription to the CTI Butler, you can do this via the API much more quickly. Once you know the location ID for Europe location--82b2b1a9-5f88-55ab-877e-812017e26fca you can pull the bundle of all objects linked to Europe like so…

curl -X 'GET' \
  'https://api.ctibutler.com/v1/location/objects/location--82b2b1a9-5f88-55ab-877e-812017e26fca/bundle/?types=location' \
  -H 'accept: application/json' \
  -H 'API-KEY: HIDDEN'

Then just parse out all the IDs for all objects that contain…

      "external_references": [
        {
          "source_name": "type",
          "external_id": "country"
        }

Which gets you

location--030350d5-1233-5ade-bea0-2907f299fff8
location--074bb095-8beb-50d1-8029-1a576b0186cc
location--08f4f802-2fc5-5218-911c-7e6a07367c58
location--0dcf6d2d-eb86-54ff-ba7e-7ae1b80fa6e2
location--14c8eade-a3b5-5ec3-8850-b3c82d4cee38
location--17a3a1f4-fdb5-5adc-9865-90412804f730
location--1966770e-1dca-5e15-9ee2-1588919ac725
location--1b4f3585-2f7e-5fdb-ac90-0a524d67ff26
location--1cf89cc0-beea-52e8-a9b7-780abe6304ca
location--1e61e788-236c-5e8c-82de-93be176d0021
location--219c009f-5073-58e5-9a80-93e4f4a3e864
location--22d767cf-dd8f-5a64-8b4f-879191e15061
location--2f32310e-da97-57dc-8ec2-94ae9ce1d3a1
location--2ffa1b95-f33c-58d3-a959-d188b98db08a
location--34b5fa9f-85f1-5623-bd91-4234dc81dd0b
location--4279e3a4-1ca8-568a-a063-577a32906840
location--49cc6331-3c73-5221-882c-8144b88506e8
location--4e9a8b79-6776-56e3-b72c-cb19a086b6a8
location--53150855-bf59-560d-a1c7-0da167dc87e1
location--56e991b3-babd-5840-9474-937dc1596f21
location--5773b069-df9c-541c-b8a5-bf3d4f6ec899
location--5db109b2-df1a-5dbd-9e18-b91efab92bdd
location--61ce4269-5def-5024-9199-f7f947fa3dec
location--62289b8b-3421-5606-8f04-a9fb60cf4412
location--62990a11-0e30-5c51-bc46-b0ce54170f9e
location--64e324d9-125b-5f94-b85c-07cf0530d340
location--72ce941a-9298-5b71-a7e2-d2975682624d
location--8190c1e6-f349-58eb-b9f1-e64923bc5f56
location--87139eb9-8ce4-5c17-90fa-9acd7115e65b
location--8d8abee9-2855-57ea-9df9-5251079802e6
location--8f4fbac9-74a7-588a-8bc1-ecdc8e1761ab
location--939912ac-dd7f-5fe7-bbf8-f502a96633f9
location--9416b124-9003-5098-a9ff-45212cb950a5
location--9ba8ba26-fde5-507c-a2fb-27eac7a27b94
location--ab330afa-7e7c-51aa-8337-afbb062ac61f
location--acf9170f-f64a-5f0b-990e-7076eccef5ea
location--b6ab8bdf-fd7b-58ad-a4c8-ff1c55ab33bb
location--bb788ff3-dd06-522a-9044-b2d5aa75cab7
location--c4bc77e6-6ba2-5b02-b9a8-649873d0e16c
location--c4da9cdc-2817-5fe0-9fde-1d31b561faf5
location--c5e59cd7-bb53-5e06-b0f6-2d0acddca71b
location--c9e633f1-fe81-5815-a7a9-6d3bd233b075
location--e7d44c80-245f-55f2-8c8e-40c366f7038c
location--ec86b95c-22d8-5ab3-a761-e1bec50664f8
location--ee79a652-014a-53ce-9b17-3e0f775fed28

2. Search posts using the Obstracts API

Using the bundle endpoint, I would then run queries to get the bundle for each of the 45 countries listed at then end of step 1.

e.g. for location--030350d5-1233-5ade-bea0-2907f299fff8

curl -X 'GET' \
  'https://api.obstracts.com/v1/objects/location--030350d5-1233-5ade-bea0-2907f299fff8/bundle/?types=report' \
  -H 'accept: application/json' \
  -H 'API-KEY: HIDDEN'

It requires a bit of code, but will give you what you want.

I have now raised a ticket for this, you can track it here: