1 00:00:07,644 --> 00:00:19,404 So, welcome to the Global Network webinars. So, my name is Alexander Loschke, and I will be moderating this webinar today, together with my colleague Yusi Sang. 2 00:00:21,404 --> 00:00:45,404 Today we have with us Mario Triani from the UN Food and Agriculture Organization, or FAOGW, who will talk about FAUSTAT, the FAUSTAT developer portal, programmatic access to FAUSTAT. API for data analysis and automation. 3 00:00:46,604 --> 00:01:06,404 During the webinar, the FAOGW Statistics Division will introduce the new FAOGW Stat developer portal, which is designed to provide programmatic access to FAOGW Stat data sets. The session will also cover what APIs are and how they can be used. 4 00:01:06,844 --> 00:01:33,337 With practical examples in Python and R, and will also showcase how the API can support AI-powered tools, making Fauerstat data more accessible and easier to integrate into analytical workflows. Let me now introduce our speaker. So Mario is the lead software developer, 5 00:01:33,337 --> 00:01:51,804 or is a lead software developer at FAOGW Statistics Division, where he leads the design and development of the statistical data platforms and web services that Deliver false agricultural and food data. 6 00:01:53,084 --> 00:02:16,221 His work focuses on building and maintaining the systems and APIs that make the data accessible and easier to integrate into analytical workflows. Before I hand over to Mario, just a few remarks. So you can write your comments and questions into the meeting chat at any 7 00:02:16,221 --> 00:02:28,844 time. But during the Q&A session, it would be nice if you could ask the question yourself. This makes everything a little bit more Lively. 8 00:02:30,844 --> 00:02:46,204 As always, this Global Network webinar is being recorded and will be made available on the Global Network of Data Officers and Statisticians on LinkedIn, and I will share the link to this in a few seconds. 9 00:02:47,164 --> 00:03:05,804 So in case you haven't joined the Global Network yet, we invite you to follow then the link in the chat and to join the group on LinkedIn. And please also sign up for our newsletter following then the other link in the chat to ensure that you 10 00:03:05,924 --> 00:03:22,844 get your monthly updates about the global network. And now over to Mario. Mario, the floor is all yours. Oh, thank you. Let me, sure. My screen. Yes. 11 00:03:27,244 --> 00:03:46,430 I hope everyone can see this. Okay. Okay. Good morning, good afternoon, everyone, depending on where you're joining from. My name is Mario. As Alex said, I'm the lead software developer in the statistics division here at FAO, and I'm the person who built the 12 00:03:46,430 --> 00:04:05,217 developer portal we are going to look today. Before we start, one thing, this session is not only for developers. It's if you ever downloaded a CLV from somewhere, especially for Fastat, and you had to download it again in three months later because the data has changed, 13 00:04:05,217 --> 00:04:20,524 because you want to do some changes, this session is for you. From here, we start from zero and we look real code in Python and a little bit snippet that everyone usually find useful, which is in Excel. 14 00:04:21,884 --> 00:04:40,604 And we talk about how also to connect this to AI tools. Question now, of course, will be at the end of the presentation. So the agenda is divided in eight blocks. First is how itself, because somebody might not know what 15 00:04:40,644 --> 00:04:59,884 that we're talking about, and just in just one slide, and then we have three ways that we can get the data from it, and we will see that. Then we have what is an API, what our API is, and how to use them. The 4th is how is... 16 00:05:01,164 --> 00:05:16,299 Sorry, the third is how the programmatic access is is useful to have reproducible workflow and use and integrating your current workflow. The 4th is how the fast APIs actually works, so it's a little bit more technical, 17 00:05:16,299 --> 00:05:32,032 how the requests look like, how to authenticate, where your costs come from, and so on. In the 50 real code examples in Python, R, and Excel, we will use the power query and you will see exactly the same query in all the 18 00:05:32,032 --> 00:05:45,999 three examples. So, it can what you prefer to what your language you prefer here. We have the developer portal. I believe it will show the developer portal itself. of the tokens, how to use the query builder, 19 00:05:45,999 --> 00:05:50,524 the documentation, you can see a small like them of the what we have there. 20 00:05:52,364 --> 00:06:10,111 At the 7th, we have first up in how to integrate this with AI powered tools, how to make use of that with user assistant or agents. And then of course, finally, we will have to how to actually use that or where to start and through questions 21 00:06:10,111 --> 00:06:13,564 that often come up and how to get in contact with us. 22 00:06:15,884 --> 00:06:34,148 So, for those who doesn't know about it or new to it, this is what is Fastet. Fastet is the false corporate statistical database. It's been online since 1996, and it's the largest database in the world. It's also one of the largest that we host 23 00:06:34,148 --> 00:06:52,604 here in a in a FAO. We have more than 65 statistical domains, over a million statistics covering 5 decades, 245 countries and territories, and about two and a half million visits per year. And then that, of course, is are free to use. 24 00:06:53,644 --> 00:07:08,504 The main organized in thematic groups, we have production, trade, which are the biggest. We have the food balances, the prices, food security, nutrition, land inputs, and emission, forestry. I mean, yeah, 25 00:07:08,504 --> 00:07:27,242 many that sets new domain are the often. Two things for today: most of them are called from countries with harmonized definition customs in international standards. means that we also have metadata for each domain that we are going to use and API 26 00:07:27,242 --> 00:07:34,604 expose them as well. API actually, you can recreate the entire website using API if you wish to do so. 27 00:07:37,084 --> 00:07:51,892 So, currently, before TalkBI, we let's say how to you can get information data from Fastnet. Currently, you have the website, so you can, it's probably the one that everybody that used that before it knows. 28 00:07:51,892 --> 00:08:10,161 You go to the website, pick a domain, you filter your information, you download the CSV or an Excel file, you also get Chart, legal briefs, and country profiles is what most of the people use in spite of exploring, and if you have one-off question, 29 00:08:10,161 --> 00:08:27,724 you have to get a quick look, but also a lot of people use bulk downloads. Bulk loads means that every domain is on a complete zip file. Refresh it that every release when you need to new, you need to everything that or works just offline. 30 00:08:28,884 --> 00:08:47,173 And then we have the new way, let's say, the API, the third door. The one URL gives you exactly 1 slice that you asked for. And the same request can be run on a script, can be used on a workbook, on AI tool, and is best for pipeline and dashboard. 31 00:08:47,173 --> 00:09:05,164 And if you want to do that again and again and again. Same data, same codes, same metadata behind all three. Nothing you learn on the website is wasted when you move. Through APIs. So, let me start with the word itself. What is an API? 32 00:09:06,844 --> 00:09:24,436 API stands for Application Programming Interface, and the definition on this slide is the only one you need. It's a way to program what you the way to program to ask a service for data instead of one person clicking on it. If you look at this four boxes, 33 00:09:24,436 --> 00:09:43,404 this is the typical request that that you have through the website. So you look at the four boxes, you check the option that you need. And for example, here you can see what is production of wheat in India. 34 00:09:44,524 --> 00:10:02,909 and you then click the selection and the request, the request is means that is what we call the domain name, QCL. You check the area, the item and the year. The first API is reserved that address, filters database, touched metadata, 35 00:10:02,909 --> 00:10:21,713 sends back a response. which is structured in JSON or CSV, it depends on, or even Excel, and it's ready to be used on R, Excel, or whatever you need. So basically, if you need to remember one sentence from this particular slide, 36 00:10:21,713 --> 00:10:36,799 this an API is for us in Fast at an URL that you query and get information from. The analogy is like a restaurant, you sit down, there's a menu, you wait for the plate. The API is the kitchen door. You have the handwritten what you want 37 00:10:36,799 --> 00:10:49,084 and you get exactly a support every time in this informant. Same kitchen, same food, but the 2nd way can be repeated, scheduled and automated. It's not every single time you order for your favorite is still your favorite. 38 00:10:52,284 --> 00:11:09,417 Okay, why we want, why we would like to have programmatic assets? The one on the left is the workflow that most of us know. It means that you navigate the website, search data set by data set, area by area, 39 00:11:09,417 --> 00:11:18,884 year by year, you download the CSV, the Excel file. When you, when Mustafa publishes an update, you go back and load it again, you reuse it for your current workload. 40 00:11:21,164 --> 00:11:34,925 Nobody can rerun the steps. I mean, technically, this way to rerun the steps, but let's say that nobody can rerun the steps because they involve manual clicking and manual work. And it's boring, let's say. 41 00:11:34,925 --> 00:11:53,094 Perhaps it's something that can be done in a better way. On the right here, you can see the The same work through APIs is 1 structured request, which is exactly like I click on the same boxes to click on the same buttons. 42 00:11:53,094 --> 00:12:11,072 And as output, you have a machine readable JSON or a CSV. It's scripted, it's automated. Its version can be reproduced or produced through pipelines and it's automated. It means that in one year time you will run it again, it will work. 43 00:12:11,072 --> 00:12:25,314 Our colleague will run, it will work. Some things happen, it will work again. It plugs natively also in your workflow, the tools you already use. like we said for Excel. But if you're going to use this written 44 00:12:25,314 --> 00:12:39,324 at the bottom, you have a country dashboard that refreshes automatically every time Fast App publishes an update, and you don't need to download or re-upload or do whatever you need to do again and again and again. 45 00:12:42,284 --> 00:12:47,324 So, how fast that APIs are built? 46 00:12:50,244 --> 00:13:07,719 On this slide, you can see that we will see the exact endpoints, so it means that there's an URL that you will have the request, stable, uniform, all across hosta domains with the full metadata also available. Everything is available as an API 47 00:13:07,719 --> 00:13:28,884 endpoint. The response of cached means that, if I request, if a person had the request done before you, means that that results is saved somewhere and it can be used. That means that there's no way to have another request and the... 48 00:13:29,244 --> 00:13:44,604 The result is very, very fast. Another thing incredibly fast is the authentication tokens are verified, let's say, at age using a lambda at age technology means that in about 1 millisecond you will not if. 49 00:13:45,644 --> 00:14:02,046 you're allowed to do the request or not. and it's working pretty well for our cases. And the access to those APIs are through our personal token. The personal token are free, self-service, and valid from one hour to five days. 50 00:14:02,046 --> 00:14:17,844 If you're not a developer, the last line is what you need to know is everything. is the same URL and keeps working. The only thing you need to manage is to get the permission to get this information from the portal. 51 00:14:19,964 --> 00:14:37,283 So, how to do a request though? Let's see. The structure is here. So every request looks like this line on the top. You have the URL, so the endpoint, which is called file. services.org. Then you have the API, version one, 52 00:14:37,283 --> 00:14:52,519 which is the current version of API we have. And then you have the language. English, French, Spanish, Chinese, Russian, and Arabic are supported. And so that you desire to have this information in a particular language that 53 00:14:52,519 --> 00:15:06,044 works for you, the labels will change. Obviously, only the labels will change, not the data. Then you have the type of information you want. It can be download, metadata box, unload, but even more. 54 00:15:08,844 --> 00:15:25,453 Then you have the domain code. Mostly the most tracked, this is a general structure that we use, but some cases it might be slightly different. You will see from the portal itself, the developer portal itself. But mostly of the request will also 55 00:15:25,453 --> 00:15:45,860 request you to know which domain, which data sets you want to know. Just using the domain code, so means that. If you want from crops or livestock, you have to specify QCL, FBS for balances, and RL for land use. Then you have to start filtering, 56 00:15:45,860 --> 00:15:50,044 so once you type the domain, you have the filter. 57 00:15:51,884 --> 00:16:11,124 The filter can be differentiated between each domain, but in general, you use that area, item, element, and year. It means that you have array of countries, item, element, and use the same code in every fast that you download. 58 00:16:11,324 --> 00:16:30,684 element and item can change based on the type of domain you currently want information from. But more or less, let's say that this is the general way to get information. In the orange box below, you can see that every 59 00:16:30,804 --> 00:16:48,417 Uh, every request needs our token, we'll see that in a minute, and... Means that if you're getting back four and 401 means authorize means that you didn't pass the token that it didn't defy you. It's not an error. 60 00:16:48,417 --> 00:17:05,903 It's just the API telling you that it doesn't know who you are. In the for example, we'll see how to this is. Just one line of code, basically. One tip that I usually say to developers and enthusiasts that once you check this 61 00:17:05,903 --> 00:17:22,284 information is to filter by year, because you will see lots of that sets. I mean, the requests can be pretty large and the results can be pretty large as well, so at least you have some results. Slice it by here. 62 00:17:23,484 --> 00:17:41,565 So, let's see how to do our request. This is an actual request. So from left to right, we can see that this in English. We want data. We want the QCL, so a crop lab stock production domain. We want India, 63 00:17:41,565 --> 00:18:01,674 so we use file stack code currently in the file stack API, so it's not M49. And we want to eat. in the production in a single year and the response. This is also important. Currently, we accept the JSON response output type 64 00:18:01,674 --> 00:18:18,249 and CSV. So it means that you can also download directly that you that you currently need. What you see below is the is what's coming back. A modeled method block that says you the processing time and the type of output 65 00:18:18,249 --> 00:18:34,867 you want you requested. And then the data array, where every row, this is obviously is an exact every row shows you part of the data that you requested. This is exactly what you see in the FowStart website. 66 00:18:34,867 --> 00:18:43,484 It's exactly the same way, exactly the same thing, but this is a... For them, you will have a for the map where you can look over and over again. 67 00:18:45,484 --> 00:18:56,444 So, the most common question we get is, okay, it's fine, but we have lots of code here. How do I know that India is 100 and with is 50? 68 00:18:58,604 --> 00:19:16,360 So, we have to raise. In the developer poster, you can have the query builder, you pick your domain, your app, your domain countries, every item, elements, and everything you need, and the URL code is generated for you. 69 00:19:16,360 --> 00:19:32,429 It's a starting point that is pretty okay. You also have the middle endpoint, so it means that if you get you want to information from a domain, you get everything that you need just for that, the URL structure, the type of information, 70 00:19:32,429 --> 00:19:49,404 the number of dimension, the dimension, the nodes, it's not machine readable output of course, so it means that. one script, you can log it in into your software logic and we will see that is important also for AI and AI section. 71 00:19:50,604 --> 00:20:09,884 And another thing that I usually say is just check what the files that website does. We have a definition of starting standard on every domain, means that codes are there. You can just read, use, and try. About the use and try, one advise never. 72 00:20:09,964 --> 00:20:28,444 guess the codes because of there, because guessing doesn't mean that you will get the information you want and more importantly, never let AI to guess them either. It's not good. So, let's see the real code. 73 00:20:29,884 --> 00:20:31,084 That starts with Python. 74 00:20:33,084 --> 00:20:53,785 So, it's exactly the same query that we said before, so it's India production for week for 2022, and this is Python. As you can see, there's no package installed. URLLib and JSON just are standard with Python. Means that in 13 lines, 75 00:20:53,785 --> 00:21:11,279 you have everything that you need to download your information. As you see here, we also have the... Adders means that you have to paste your token. The token is taken from the website from the developer portal. 76 00:21:11,279 --> 00:21:30,924 This also ways to automatize this information, so you can get automatically. There's an API to get the token, so you don't need to. To have anything else, and then you have the request call, and the data becomes an array here. 77 00:21:33,164 --> 00:21:53,004 From here, you can get Pandas.frame, that to give you a table, whatever you like, whatever you want, basically. From here, you can just use the information as you want. And we also have one open source package coming from a university 78 00:21:53,324 --> 00:22:20,800 in Italy that is published on PYEI. It's called Faster. If you prefer a wrapper to just do your things in a less manual way. Just probably everybody knows that. It's just good practice to keep the token out of your code and never disable TLS 79 00:22:20,800 --> 00:22:45,126 verification. And just, that's good practice, let's say. So, let's move to the next language, which is R. I'm not an R expert, but I checked with colleagues that are way more capable than me, and basically this is the way to use R for from fast APIs. 80 00:22:45,126 --> 00:23:01,583 This again is from the environment. From then, from the environment, we have the base URLs variable, the pipeline, so request the parameters is the exact query that we saw again and again. The response body goes through the rest 81 00:23:01,583 --> 00:23:20,230 body JSON with simplified vector true, and you get the data frame straight away. ready to use to whatever you prefer. If you prefer CSV, output type equals CSV. And even in this case, you will have a package called Castro 82 00:23:20,230 --> 00:23:32,924 from an independent developer is also available on RAM. But I want to highlight that seven point, same parameters, same program, different language. 83 00:23:34,764 --> 00:23:53,164 And now, the thing that usually gets most reaction from the developers, Excel, with no audience required, just our query which is built inside Excel, and here is the whole query. Yeah, the token again, the URL. 84 00:23:53,204 --> 00:24:00,924 the either that with the authorization bearer token, web contents to fetch. And. 85 00:24:02,844 --> 00:24:22,348 PSB2 document to parse, promote that needers. In just 9 lines of code, you have everything that you want, that you need for get your information directly from the APIs right to Excel. And it's usually very simple; you can obviously have, I mean, 86 00:24:22,348 --> 00:24:41,804 we are not limited for just those 3 languages; you can build everything you need, everything you want in your favorite language, but the important thing is everything is coming from the development. In the developer portal, like we said, we have token management, the building, 87 00:24:41,804 --> 00:24:55,774 the query builder, then point augmentation with all the endpoints, all the parameters, mission code, some ready to use snippets that you just saw. What's all that systems tabs in case there's a problem of connectivity, 88 00:24:55,774 --> 00:25:22,549 you can. Tell, um, exactly, exactly where it is. So, um... Okay, let me show you what the developer portal looks like. So from here, you can see that you have the welcome page, where you can see the system status, libraries and ecosystem with direct link 89 00:25:22,549 --> 00:25:38,844 from here. Is the way that you, the small pages that you can get the personal access token, you can copy that. And some snippets to just use is this. is another example of the same query again and again. 90 00:25:40,684 --> 00:25:47,644 Then you have the pre-builder, where you can create your own query here. Let's do something different with trade. 91 00:25:54,444 --> 00:26:14,004 The query might not get sense, sometimes it doesn't. But in here, you have the direct endpoint to get this information. And colleagues found the Excel snippet very useful here, where you can, we also have your token ready to use here. Just copy and paste. 92 00:26:15,324 --> 00:26:33,804 And also the API documentation, where you can get all the information. There's also interactive documents where you can get all the information, you can test it, you can try it. And also open API specification in in case you need. 93 00:26:36,924 --> 00:26:54,821 Okay, let's go back to a little bit numbers because we are still the statistic division, so we want to see some statistics. Those are the updated this morning. Since the launch, we relaunched it recently this year and 94 00:26:54,821 --> 00:26:55,724 we had 1500 95 00:26:57,644 --> 00:27:17,084 More than 1000 users that have done at least one authenticated calls API means that they've tried to use API at first, 2. 7 million API requests since the launch, 99 API requests per week, and currently we have more or less. 96 00:27:17,284 --> 00:27:22,364 Ten percent of all the requests in Fastat are going through APIs. 97 00:27:24,524 --> 00:27:46,284 Okay, probably this is the... section of this workshop where we get more excited about, which is how to use Fastat and AI powered tools means that how do I get information directly from Fastat APIs to my API power tools. 98 00:27:47,964 --> 00:28:06,124 So, the flow loop looks like this. Someone asks the question of plain language. How did web production in India change from 2025 to 2022? And I assistant understand the question, looks up the code, looks the metadata, writes the request. 99 00:28:06,924 --> 00:28:14,524 Fast APIs return the official figures with flags, units, and everything. The assistant copies the trend, draft the charts, cite the sources. 100 00:28:16,524 --> 00:28:30,524 The 2 bugs below are the division of the labour. This is the core of the message section and the way the AI is good at. Turning question into the right domain, filters and code. Writing with Python or our query. 101 00:28:32,124 --> 00:28:47,236 They will do that for you. The numbers come from some models memory, and the codes are resolved and gets real metadata, not guessed, and every answer can be traced back to a reproducible URL. It's that you have your exactly your 102 00:28:47,236 --> 00:29:05,404 question that you want. Language models are excellent writing queries and terrible and remembered numbers. Try to guess, try to use your favorite tool to let them guess a number. The API is the piece that keeps the AI answer correct, honest. 103 00:29:06,924 --> 00:29:24,301 Okay. Oops. Let's see how to do that. So we have three patterns from simple to advanced, let's say. One is the previous system, you ask the plain language, you get URL codes back from the snippet, works today in NChat Assistant, 104 00:29:24,301 --> 00:29:30,364 but the API structure from next slide. Uhh... And you will have. 105 00:29:32,484 --> 00:29:51,374 a conversation and ask. It's good for non-programmers. You just ask them, use this structure to get information and you will allow the results. The second is an agent with a tool. It means that API expose it as a tool and a system can call itself through a 106 00:29:51,374 --> 00:30:07,768 functionality called Model context parallel protocol MCP. The system fetches the information and answers the real figures. There's already a project that exists that uses FastData, like FastMCP that you can find on GitHub 107 00:30:07,768 --> 00:30:23,303 that is built from one colleague from the statistic division. And also the link is also available on the developer portal. And the portal makes it easy because they are rather stable, the scheme is stable, 108 00:30:23,303 --> 00:30:38,454 nothing will change and they can keep use that again and again. Then you also have, like, let's say the expert level, automated analysis. You schedule a pipeline that pulls data through API, through a language model, 109 00:30:38,454 --> 00:30:53,384 writes a narrative, country briefs, and other checks, and new releases, multi-language summaries, but... you will use the same URL, same results, same more or less same thing. Three ground rules for everything, alter the three patterns. 110 00:30:53,384 --> 00:31:10,222 Codes come from the middle of the endpoint, never from the model memory. Token stays on the server side, never in the prompt, and every number AI generated should be checked. And there should also the request that comes from and through the AI models 111 00:31:10,222 --> 00:31:17,844 should be checked as well, because this is a great tool, but we still have to manually check this information. 112 00:31:20,284 --> 00:31:20,844 Okay. 113 00:31:23,204 --> 00:31:47,111 Let's move to the, yeah, this, sorry. This is a schema that allows you to... to use the pattern. So you can copy and paste this information directly to the AI agent or AI assistant that you're using. Means that he has the information to do the query themselves. 114 00:31:47,111 --> 00:31:57,644 You just need to pass them the token. So, on the right, you have the interaction between you and the AI. 115 00:31:59,964 --> 00:32:17,884 Mobile. And this is described, this describes the way that you should ask the information that is coming from directly from the MCP. So, you have like a comparison, for example, between India and Pakistan for production week. 116 00:32:19,484 --> 00:32:30,204 in five years? The answer should be a short comparison with official figures, units, flags, and the two URL requested, one from India and one from Pakistan. 117 00:32:32,364 --> 00:32:45,164 The last part is the difference between the AI answer you can trust and you cannot, in the sense that here you're playing directly the information, you are not letting the AI agent trying to guess it. 118 00:32:46,844 --> 00:33:05,321 I'm sorry for the jump, but this was supposed to be at an earlier stage. So, from... Those colleagues that and users, we have very quickly the question that we get every time. So the API is public, yes, the API is public and free. 119 00:33:05,321 --> 00:33:22,926 The personal token is taken from the portal and sharing the portal with our institution is encouraged. Actually, you can get all the information you need in there. Formats are JSON and CSV. They're stable. Excel output is experimental at this 120 00:33:22,926 --> 00:33:37,644 moment. They're testing it. We have ready-made libraries, like we said. All domains are covered. Like I said, everything is covered in the files that APIs. You can rebuild the entire website itself if you want. 121 00:33:39,404 --> 00:33:55,962 The query size limits currently, we don't have an account, but please get all the information you need. If you need bigger information, bigger chunk of data, you can use the back downloads. And this might change in the future if you see, 122 00:33:55,962 --> 00:34:15,572 if we will see that this will be exploded. And more importantly, you can request feature help and everything. Yes, we have a feedback system in the portal to just get information. And we also have an e-mail to get the 123 00:34:15,572 --> 00:34:18,444 information. So to wrap up. 124 00:34:21,724 --> 00:34:40,604 If you want to try this today, tomorrow, those are the five steps that you sign in to the developer portal. You generate the token, you pick it, you start to use it. You can use to the query builder, query builder as you see as just there, just a copy and paste. And you can. 125 00:34:40,684 --> 00:35:00,355 also start to using that right now through Excel. And then we probably want to automate it. So I mean that this just can be script, refresh the workbook, you plug it into your actual, basically the limit is yours, that you can just do reasonably whatever 126 00:35:00,355 --> 00:35:24,485 you want. And this more or less wrap up my presentation. So thank you very much. Hope you didn't get bored. And let's go to the questions. I don't know, Alex, if you want to. Thank you, and thank you, Mario, for this great presentation about the 127 00:35:24,485 --> 00:35:31,004 developer portal. I would like now to invite everyone to 128 00:35:34,284 --> 00:35:48,204 to ask questions for that, I will actually allow cameras and microphones. So I'm just changing that right now. So anyone who wants to 129 00:35:50,124 --> 00:36:05,404 Ask a question, please raise your hand. That would be really nice. And then we can see. Who wants to ask something? Crowd is a little bit shy. 130 00:36:08,684 --> 00:36:18,484 Maybe I can start with asking one question actually. So you mentioned for using the... 131 00:36:20,764 --> 00:36:39,324 API, I need to generate a personal token, right? I need to sign in, generate the token, and then I can start using the API through Python or R or whatever I want to use. Is it also possible to generate this? 132 00:36:39,404 --> 00:36:57,244 token in a programmatic way. Maybe I missed that and yeah, please. Yeah, I can show that in the... In the in the presentation. But let me re-share my screen very briefly. Yeah, that's... 133 00:36:59,404 --> 00:37:18,044 Here, you can see that you can do a call. It's a different type of public. So far, we have them get URL calls. But if you can, this is the way to get the token programmatically. You have to expose your username and password. And 134 00:37:18,844 --> 00:37:33,398 Right to type of context, but we also have an out slash login authentication endpoint means that if you pass your username and password, you can get the information back directly. The response will be your user token. 135 00:37:33,398 --> 00:37:56,561 That means that with one in two calls, you can also avoid two. to do the copy and paste. Okay, the... And this is this is done to to to allow further automatization of the the workflow. Okay, thanks. Great to point this out. I see now two attendees have their hands 136 00:37:56,561 --> 00:38:03,244 up. Isabella, you want to come in first? Isabella works for UN Women. 137 00:38:07,964 --> 00:38:24,844 Hello, thanks a lot. This was really a very clear and concise explanation of how your IPA works. It's going to be extremely useful to all of us. My question is really the underlying data that one can access through this process that you develop. 138 00:38:25,724 --> 00:38:39,804 How often is it updated and are there specific times in the year when one should look out for sourcing it from the FAO website to get the latest information or is it just continuously being updated? 139 00:38:42,684 --> 00:39:05,444 This is more data related question, but I try to answer that. Let me re-share my screen once more, because in fast that we also have a release calendar. where you can get the last release and the planned next release of each domain. 140 00:39:05,444 --> 00:39:21,044 And you can search through it, browse it, and obviously, there's an API for that. So an API endpoint for that, you can also automatic that. and put that into your workflow. 141 00:39:25,484 --> 00:39:35,244 Thank you. I also see that Cody Wallace has the hand up. Cody, please come in. 142 00:39:38,204 --> 00:39:56,444 Great. Thank you so much, colleagues. And just first of all, huge congratulations on the launch of the developer portal here for colleagues. I think it's really impressive to see this initiative, certainly all the features that 143 00:39:56,564 --> 00:40:15,884 the API offers and just the robust features of the MCP, the tooling that's being offered. It's really, yeah, a huge congratulations. I think, you know, my question was really, I really honed in on the MCP workflow. 144 00:40:16,484 --> 00:40:38,164 And given, I mean, the where we are in the agentic AI era, if you could elaborate the just or signpost if the so is there MCP documentation available as well on the the portal platform and is this maintained by FAO or? 145 00:40:39,244 --> 00:40:59,098 this is community maintained, and we could potentially have contributions like pull requests and such. Yeah, and I'll leave it at that for now. But thank you again. Yeah, thank you for the question. Yeah, it's an interesting question. And yeah, 146 00:40:59,098 --> 00:41:21,324 we have, we don't have a... Let's say file MCP server, but there's one on available on GitHub. You can find the link on the developer port in the developer port within the libraries and ecosystem and is developed by a colleague is mostly and we will. 147 00:41:21,804 --> 00:41:43,689 Unfortunately, I could not have time to also show the real-time. Example for that, but I mean, it's available on GitHub and it's MIT license, so you can contribute to the code and reuse that freely. The one thing that I didn't have 148 00:41:43,689 --> 00:42:03,396 highlighted every the use of data in. FAO from the statistic portal is subject to the study file statistical database term of use, which is CC by 4.0. And means that, yeah, you can you can freely use that and 149 00:42:03,396 --> 00:42:07,484 cancel freely use the MCP that is available on GitHub. 150 00:42:11,084 --> 00:42:26,764 Thanks so much. Thank you. Thanks. I see also, I see Javier on the camera and Javier has put a question there also in the chat. Javier, you want to please ask it? 151 00:42:30,364 --> 00:42:45,978 Sure. Thank you, colleagues. Greens from Brasilia. Thank you, Mario, for the very nice presentation, the step by step. For some of us that we are not very exposed to do the APIs frequently, it's always like a new discovery every single time a line of code comes into the 152 00:42:45,978 --> 00:42:51,164 screen in a presentation. My question is very simple. Can this be also created on a Stata? 153 00:42:54,724 --> 00:43:13,488 Yeah, of course, I mean, you can create in any language you want. The endpoint is, I don't know, it's not very well, but there's for sure a way to ask information through our website. Once more, use the same endpoint, and the same endpoint is always the same. 154 00:43:13,488 --> 00:43:22,604 You do the query in there, you get the information, then you can manipulate in any language you want, basically. You can. Yeah, of course you can do it. 155 00:43:25,164 --> 00:43:31,484 Thanks so much. Any other questions, please raise your hands. 156 00:43:33,644 --> 00:43:51,084 Otherwise, I see also a few questions in the meeting chat, which I can read out. There's a question by Tracy. So is there also subnational data available? In Fauerstat. 157 00:43:53,324 --> 00:43:54,524 So I guess by provinces, regions, or something like that. And this is. 158 00:43:57,004 --> 00:44:18,124 This is more a question on the data than APIs. I will let colleagues that, as statistician colleague were here to answer that, but I don't recall that we have much sub-national data in Fastat, but any data that is available on Fastat is available through APIs. 159 00:44:18,844 --> 00:44:23,364 So, if you find that there in the website, you can find it in the APIs. 160 00:44:25,404 --> 00:44:31,004 Yeah. Anyone else wants to come in, please raise your hand. 161 00:44:36,604 --> 00:44:57,484 Otherwise, I'd take another question from the chat. So Girish Patil was asking, so some websites use bot checks to determine whether the user is a human or a bot. And now the question has moved, sorry. In such situations, how does the API work? 162 00:44:59,084 --> 00:45:14,476 Our API doesn't discriminate between humans or bots. Everyone is welcome. You just bring your own token. If your bot or your script has direct token, you can get information. So obviously the website gets its own 163 00:45:14,476 --> 00:45:29,972 token as well. It's that when you browse and use the website, every request gets a token. So it just depends on if it's human doing queries in Excel about a script that automatics get information from. 164 00:45:29,972 --> 00:45:34,124 Same thing, bring your own token and you'll be welcome. 165 00:45:38,684 --> 00:45:42,164 All right. Anyone else? 166 00:45:44,204 --> 00:45:45,404 Any other questions? 167 00:45:52,044 --> 00:46:17,538 I can also take a question from the registration form. And so there was a question, how would you recommend interacting with the API for bulk downloads, such as pulling indicators for all countries in a region. I think you have mentioned it before a 168 00:46:17,538 --> 00:46:36,362 little bit, but maybe you can elaborate a little bit more on that, how to do bulk requests, and if it's possible through the API. Absolutely, absolutely. So, uh... Technically, you can get all the information you want 169 00:46:36,362 --> 00:46:53,684 and you need from the APIs. It just is not very convenient. Means that you do the requests. For example, you get, I want all the information from one entire domain. So it means that I want all the production information through APIs. 170 00:46:53,964 --> 00:47:12,844 You do the request. The request gets elaborated from the server. Obviously, every request has a timeout time, means that we don't know the system. We will not know if the request is lost, still processed or processed, means that 171 00:47:13,244 --> 00:47:31,673 After a certain amount of time, the request will break. That means that you do the request, you wait a lot of time for machines, and then you get my information back. So we usually suggest to use bot downloads if you want to do further 172 00:47:31,673 --> 00:47:53,244 analysis, so big analysis, so big chunk of data sets, and obviously with an API to get all the information from bot downloads. And also the bot downloads are available, searchable through APIs. But the suggestion that we usually ask people using, if you have... 173 00:47:54,204 --> 00:48:08,167 or you have the need of big chunk of data sets, use the bulk to load this zip file. Even that one is cached, so it means that is available is very fast download. And you get all the information there. 174 00:48:08,167 --> 00:48:22,705 Actually, we have workflow that gets all the database downloaded. It's also one. A huge zip file that get that got the entire data base, so it depends on your workflow, but we suggest if you have a small, 175 00:48:22,705 --> 00:48:31,164 if you need small data sets frequently, use API. If you need to download big chunk of data sets, use the back download. 176 00:48:33,324 --> 00:48:55,053 All right. Thank you. I see Inkyung Choi has her hand up. Inkyung, please comment. Thank you. Yes, thank you very much for this very interesting presentation. I have a question around the usage data. So do you plan or are you already using the usage data? 177 00:48:55,053 --> 00:49:15,304 Because I guess the API could provide a more disaggregated level of usage, like for each product, for each even data format that which format of data JSON, CSV, which is more preferred, etc. And also related to the MCP. It's interesting, 178 00:49:15,304 --> 00:49:26,204 this community project type of MCP server popping up. And do you, as a FAO, plan to develop more official one? 179 00:49:28,844 --> 00:49:47,324 Okay, let me start for the last one. Yeah, we very well come and encourage a community-based project, means that there's still an interest in the work we do. And now currently for FASTA, since there's 180 00:49:47,484 --> 00:49:53,244 Open source tools are already available. We plan to not create our own version. 181 00:49:55,084 --> 00:50:17,437 Also, during the build of the David developer portal, we connected to the original developers to use the authorization token to let not break the work. We also don't want to do. the same works twice. There's an open source community that 182 00:50:17,437 --> 00:50:24,844 have built something that works. It's fine for us. Just follow the rules, use the token. It's good for us. 183 00:50:26,684 --> 00:50:44,964 Regarding your first question, I believe is more about the data itself. So unfortunately, I'm not a statistician, I'm not an expert on the data. So I believe that is more for colleagues than a statistician in FAO to answer that. 184 00:50:45,964 --> 00:50:51,964 I have to reply in the same way. If it's available on a FAO, that means that is available through APIs. 185 00:50:54,684 --> 00:51:06,284 The different level of aggregation of data sets is done before it reaches FAO, before it reaches fast that means that is also done before it reaches APIs. 186 00:51:10,124 --> 00:51:16,844 All right. Thank you also for this answer. Anyone else wants to come in? 187 00:51:18,684 --> 00:51:20,204 Please raise your hand now. 188 00:51:23,164 --> 00:51:25,004 Uh, yeah, Yuxi, please come in. 189 00:51:28,404 --> 00:51:45,598 All right, thank you, Alex, and thank you so much, Mario, for this great presentation. I think it will be really helpful to query the data in a programmatic way. And just, I'm just curious if there's like a thorough or comprehensive documentation 190 00:51:45,598 --> 00:52:07,469 for the API that, you know, any developer could be used, or I'm not sure if that's been. published online. Yeah, thank you. Yeah, on the developer portal, you can find a documentation tab where you can find 2 files. Let's say one is an interactive section, 191 00:52:07,469 --> 00:52:24,764 but you can list every single endpoint and with all the information that you need to. request for that specific endpoint and the result that you're going to expect. Also, there is what is called then a Yan file. 192 00:52:25,684 --> 00:52:43,853 which is written in the open API standard, means that is also that is AI ready, machine readable. It can be used to generate several automated information to be used, and every single endpoint for fast API is 193 00:52:43,853 --> 00:52:58,764 available there. So it means that you get, you can use that with your AI tools or just read it and try to use that in the old-fashioned way if you want. Yeah, thank you so much, Mario. Really helpful. 194 00:52:59,724 --> 00:53:08,604 They're great, great information also. So, anyone else last chance to ask questions? 195 00:53:13,804 --> 00:53:31,964 I don't see any. Well, then maybe we can conclude. I just want to mention once more, we will share the recording and the presentation slides in the Global Network of Data Officers and Statisticians. I have shared the link in the meeting chat. 196 00:53:32,244 --> 00:53:47,804 And before we all go, maybe we can turn on all our cameras and maybe all our microphones and give Mario a big round of applause. I think that would be really amazing. So please turn on your camera. Thanks. 197 00:53:50,764 --> 00:54:12,523 Thank you. Thank you all. External. What's one? Thanks. Yeah, this is always kind of my favorite moment because it shows that there are actually people sitting on the other side. And yeah, thanks everyone for joining. Please join us again next time for our 198 00:54:12,523 --> 00:54:36,404 next webinar. I will send out the invitation probably tomorrow, so look out for it. But the information is already available in our newsletter that we had sent out recently. And this will be about the collaborative on administrative data on the 29th. 199 00:54:36,524 --> 00:54:44,644 of September. So thanks again for joining. Have a great rest of your day. Thank you so much. Bye bye. Bye. Thank you all. Excellent. Thank you. Thank you, Mario. Thank you, everyone. Bye bye. Thank you. Bye bye. Thank you. 200 00:54:44,644 --> 00:54:48,124 Thank you. Bye bye. Thank you, colleagues. Thanks, Felipe.